remove 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # VPN Client app for YunoHost
  3. # Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
  4. # Contribute at https://github.com/labriqueinternet/vpnclient_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 vpnclient domain)
  20. # The End
  21. sudo systemctl stop ynh-vpnclient-checker.service
  22. sudo systemctl disable ynh-vpnclient-checker.service
  23. sudo systemctl stop ynh-vpnclient-checker.timer && sleep 1
  24. sudo systemctl disable ynh-vpnclient-checker.timer
  25. sudo systemctl stop ynh-vpnclient
  26. sudo systemctl disable ynh-vpnclient
  27. sudo yunohost service remove ynh-vpnclient
  28. sudo rm -f /etc/systemd/system/ynh-vpnclient* /usr/local/bin/ynh-vpnclient*
  29. sudo rm -f /tmp/.ynh-vpnclient-*
  30. # Remove confs
  31. sudo rm -f /etc/openvpn/client.conf{.tpl,.tpl.restore,}
  32. sudo rm -f /etc/nginx/conf.d/${domain}.d/vpnadmin.conf
  33. sudo rm -f /etc/php5/fpm/pool.d/vpnadmin.conf
  34. sudo rm -f /etc/yunohost/hooks.d/90-vpnclient.tpl
  35. sudo rm -f /etc/systemd/system/openvpn@.service
  36. # Remove certificates
  37. sudo rm -rf /etc/openvpn/keys/
  38. # Restart services
  39. sudo systemctl restart php5-fpm
  40. sudo systemctl reload nginx
  41. # Remove sources
  42. sudo rm -rf /var/www/vpnadmin/
  43. exit 0