remove 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # PirateBox app for YunoHost
  3. # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  4. # Contribute at https://github.com/jvaubourg/piratebox_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. # Retrieve arguments
  19. domain=$(sudo yunohost app setting piratebox domain)
  20. # The End
  21. sudo service ynh-piratebox stop
  22. sudo yunohost service remove ynh-piratebox
  23. sudo rm -f /etc/init.d/ynh-piratebox
  24. sudo rm -f /tmp/.ynh-piratebox-*
  25. # Update firewall
  26. sudo yunohost firewall disallow UDP 4253
  27. sudo yunohost firewall disallow TCP 4280
  28. # Remove confs
  29. sudo rm -f /etc/nginx/captive-piratebox.conf
  30. sudo rm -f "/etc/nginx/conf.d/${domain}.d/piratebox.conf"
  31. sudo rm -f /etc/php5/fpm/pool.d/{captive-,}piratebox.conf
  32. # Delete fakedns
  33. sudo rm -f /usr/local/bin/piratebox_fakedns
  34. # Restart services
  35. sudo yunohost service stop php5-fpm
  36. sudo yunohost service start php5-fpm
  37. sudo service nginx reload
  38. # Remove tmp folder
  39. sudo rm -rf /var/spool/piratebox/
  40. # Remove sources
  41. sudo rm -rf /var/www/piratebox/
  42. sudo rm -rf /var/www/piratebox_admin/
  43. exit 0