Julien VAUBOURG aac96974c6 * Add input checks
* Add connections without certificate
* Fix bug with credentials update
2014-11-14 00:12:43 +01:00

35 lines
805 B
Bash

#!/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
# 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