remove 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # Tor Client app for YunoHost
  3. # Copyright (C) 2015 Emile Morel <emile@bleuchtang.fr>
  4. # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  5. # Contribute at https://github.com/bleuchtang/torclient_ynh
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. # Retrieve arguments
  20. domain=$(sudo yunohost app setting torclient domain)
  21. # The End
  22. sudo service ynh-torclient stop
  23. sudo yunohost service remove ynh-torclient
  24. sudo rm -f /etc/init.d/ynh-torclient
  25. sudo rm -f /tmp/.ynh-torclient-*
  26. # Update firewall for DHCP
  27. sudo yunohost firewall disallow UDP 9053
  28. sudo yunohost firewall disallow TCP 9040
  29. # Remove confs
  30. sudo rm -rf /etc/tor*
  31. sudo rm -f /etc/nginx/conf.d/${domain}.d/torclient.conf
  32. sudo rm -f /etc/php5/fpm/pool.d/torclient.conf
  33. # Restart services
  34. sudo yunohost service stop php5-fpm
  35. sudo yunohost service start php5-fpm
  36. sudo service nginx reload
  37. # Remove sources
  38. sudo rm -rf /var/www/torclient/
  39. sudo rm -rf /etc/apt/sources.list.d/torproject.list
  40. sudo apt-get update
  41. # Remove packets
  42. # The yunohost policy is currently to not uninstall packets (dependency problems)
  43. sudo apt-get --assume-yes --force-yes remove tor torsocks
  44. exit 0