1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- # Retrieve arguments
- domain=$(sudo yunohost app setting vpnclient domain)
- # The End
- sudo service ynh-vpnclient stop
- sudo yunohost service remove ynh-vpnclient
- sudo rm -f /etc/init.d/ynh-vpnclient
- # Remove confs
- sudo rm -f /etc/openvpn/client.conf{.tpl,}
- sudo rm -f /etc/nginx/conf.d/${domain}.d/vpnadmin.conf
- sudo rm -f /etc/php5/fpm/pool.d/vpnadmin.conf
- # Remove certificates
- sudo rm -rf /etc/openvpn/keys/
- # Restart services
- sudo yunohost service stop php5-fpm
- sudo yunohost service start php5-fpm
- sudo service nginx reload
- # Remove sources
- sudo rm -rf /var/www/vpnadmin/
- # Remove user
- sudo userdel -f vpnadmin
- # Restart hotspot service if installed to change NAT configuration
- # A new start will fix the interface without unsetting all stuff
- sudo yunohost app list -f hotspot --json | grep -q '"installed": true'
- if [ "$?" -eq 0 ]; then
- sudo service ynh-hotspot start
- fi
- # Remove packets
- # The yunohost policy is currently to not uninstall packets (dependency problems)
- ## sudo apt-get --assume-yes --force-yes remove openvpn php5-fpm
- exit 0
|