remove 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # Wifi Hotspot app for YunoHost
  3. # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  4. # Contribute at https://github.com/labriqueinternet/hotspot_ynh
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. source ./helpers
  19. # Retrieve arguments
  20. domain=$(sudo yunohost app setting hotspot domain)
  21. # The End
  22. ynh_systemctl stop ynh-hotspot
  23. sudo systemctl disable ynh-hotspot
  24. sudo yunohost service remove ynh-hotspot
  25. sudo rm -f /etc/systemd/system/ynh-hotspot.service /usr/local/bin/ynh-hotspot
  26. sudo rm -f /tmp/.ynh-hotspot-*
  27. # Update firewall for DHCP
  28. sudo yunohost firewall disallow --ipv6 UDP 547
  29. sudo yunohost firewall disallow UDP 67
  30. # Remove confs
  31. sudo rm -fr /etc/dnsmasq.dhcpd/
  32. sudo rm -f /etc/hostapd/hostapd.conf{.tpl?,}
  33. sudo rm -f /etc/nginx/conf.d/${domain}.d/wifiadmin.conf
  34. sudo rm -f /etc/php5/fpm/pool.d/wifiadmin.conf
  35. # Remove free firmwares
  36. if ! dpkg -l firmware-atheros &> /dev/null; then
  37. sudo rm -f /lib/firmware/htc_7010.fw
  38. sudo rm -f /lib/firmware/htc_9271.fw
  39. fi
  40. # Restart services
  41. sudo systemctl restart php5-fpm
  42. sudo systemctl reload nginx
  43. # Remove sources
  44. sudo rm -rf /var/www/wifiadmin/
  45. exit 0