123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #!/bin/bash
- source _common.sh
- source /usr/share/yunohost/helpers
- ynh_print_info "Loading installation settings..."
- app=$YNH_APP_INSTANCE_NAME
- domain=$(ynh_app_setting_get $app domain)
- path_url=$(ynh_app_setting_get $app path)
- is_public=$(ynh_app_setting_get $app is_public)
- final_path=$(ynh_app_setting_get $app final_path)
- rm -f /etc/nginx/conf.d/${domain}.d/vpnadmin.conf 2>/dev/null
- rm -f /etc/php/*/fpm/pool.d/vpnadmin.conf 2>/dev/null
- if [ -d /var/www/vpnadmin ]; then
- mv /var/www/vpnadmin /var/www/${app}
- fi
- ynh_abort_if_errors
- ynh_print_info "Installing dependencies..."
- ynh_install_app_dependencies "$pkg_dependencies"
- tmpdir=$(mktemp -d /tmp/vpnclient-upgrade-XXX)
- cp -r /etc/openvpn/client* ${tmpdir}
- vpnclient_deploy_files_and_services
- cp -r ${tmpdir}/client* /etc/openvpn/
- ynh_secure_remove ${tmpdir}
- yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
- if ynh_exec_warn_less yunohost service status $service_checker_name >/dev/null
- then
- yunohost service remove $service_checker_name
- fi
- ynh_print_info "Restart services..."
- systemctl -q is-active $service_name && yunohost service restart $service_name
- systemctl -q is-active $service_checker_name && systemctl restart $service_checker_name
- systemctl -q is-active $service_checker_name.timer && systemctl restart $service_checker_name.timer
- ynh_print_info "Upgrade of $app completed"
|