remove 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # Remove confs
  27. sudo rm -rf /etc/tor*
  28. sudo rm -f /etc/nginx/conf.d/${domain}.d/torclient.conf
  29. sudo rm -f /etc/php5/fpm/pool.d/torclient.conf
  30. # Restart services
  31. sudo yunohost service stop php5-fpm
  32. sudo yunohost service start php5-fpm
  33. sudo service nginx reload
  34. # Remove sources
  35. sudo rm -rf /var/www/torclient/
  36. sudo rm -rf /etc/apt/sources.list.d/torproject.list
  37. sudo apt-get update
  38. # Remove packets
  39. # The yunohost policy is currently to not uninstall packets (dependency problems)
  40. sudo apt-get --assume-yes --force-yes remove tor torsocks
  41. exit 0