12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #!/bin/bash
- source _common.sh
- source /usr/share/yunohost/helpers
- ynh_print_info "Stopping and removing services"
- systemctl stop $service_checker_name.timer && sleep 1
- systemctl disable $service_checker_name.timer --quiet
- systemctl stop $service_checker_name
- systemctl disable $service_checker_name --quiet
- if ynh_exec_warn_less yunohost service status $service_name >/dev/null; then
- yunohost service stop $service_name
- yunohost service disable $service_name --quiet
- yunohost service remove $service_name
- fi
- for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*); do
- ynh_secure_remove "$FILE"
- done
- ynh_print_info "Removing openvpn configuration"
- ynh_secure_remove /etc/openvpn/client.conf
- ynh_secure_remove /etc/openvpn/client.conf.tpl
- ynh_secure_remove /etc/openvpn/client.cube
- ynh_secure_remove /etc/openvpn/client.ovpn
- ynh_secure_remove /etc/openvpn/scripts/run-parts.sh
- for FILE in $(ls /etc/openvpn/scripts/route-up.d/*-vpnclient-* /etc/openvpn/scripts/route-down.d/*-vpnclient-*); do
- ynh_secure_remove "$FILE"
- done
- ynh_secure_remove /etc/yunohost/hooks.d/90-vpnclient.tpl
- ynh_secure_remove /etc/systemd/system/openvpn@.service.d/override.conf
- ynh_secure_remove /etc/openvpn/keys
- systemctl daemon-reload
- ynh_print_info "Reloading firewall"
- yunohost firewall reload
- ynh_print_info "Removal of $app completed"
|