1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- source _common.sh
- source /usr/share/yunohost/helpers
- #=================================================
- # STOP AND REMOVE SERVICES
- #=================================================
- 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 remove $service_name
- fi
- ynh_remove_logrotate
- for FILE in $(ls /etc/systemd/system/$service_name* /usr/local/bin/ynh-vpnclient* /tmp/.ynh-vpnclient-*); do
- ynh_secure_remove "$FILE"
- done
- #=================================================
- # SPECIFIC REMOVE
- #================================================
- ynh_print_info "Removing openvpn configuration"
- # Remove openvpn configurations
- ynh_secure_remove /etc/openvpn/client.conf
- ynh_secure_remove /etc/openvpn/client.cube
- ynh_secure_remove /etc/openvpn/client.ovpn
- # Remove openvpn script
- 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
- # Remove openvpn service
- ynh_secure_remove /etc/systemd/system/openvpn@.service.d/override.conf
- # Remove openvpn certificates
- ynh_secure_remove /etc/openvpn/keys
- # Reload systemd configuration
- systemctl daemon-reload
- # Make sure to reload the firewall now that the post_iptables_rules ain't there anymore
- ynh_print_info "Reloading firewall"
- yunohost firewall reload
- #=================================================
- # END OF SCRIPT
- #=================================================
- ynh_print_info "Removal of $app completed"
|