No more service_name
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
pkg_dependencies="php7.0-fpm sipcalc dnsutils openvpn curl fake-hwclock"
|
pkg_dependencies="php7.0-fpm sipcalc dnsutils openvpn curl fake-hwclock"
|
||||||
|
|
||||||
|
service_name="ynh-vpnclient"
|
||||||
|
service_checker_name=$service_name"-checker"
|
||||||
|
|
||||||
to_logs() {
|
to_logs() {
|
||||||
|
|
||||||
# When yunohost --verbose or bash -x
|
# When yunohost --verbose or bash -x
|
||||||
@@ -200,7 +203,3 @@ function vpnclient_deploy_files_and_services()
|
|||||||
|
|
||||||
ynh_add_systemd_config $service_checker_name "$service_checker_name.service"
|
ynh_add_systemd_config $service_checker_name "$service_checker_name.service"
|
||||||
}
|
}
|
||||||
|
|
||||||
function service_is_managed_by_yunohost() {
|
|
||||||
yunohost service status $1 >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
@@ -25,8 +25,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||||||
|
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
service_name=$(ynh_app_setting_get $app service_name)
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# STANDARD BACKUP STEPS
|
||||||
|
@@ -43,9 +43,6 @@ path_url=$(ynh_normalize_url_path "$YNH_APP_ARG_PATH")
|
|||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path="/var/www/$app"
|
final_path="/var/www/$app"
|
||||||
|
|
||||||
service_name="ynh-vpnclient"
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
@@ -64,7 +61,6 @@ ynh_print_info "Storing installation settings..."
|
|||||||
|
|
||||||
ynh_app_setting_set "$app" domain "$domain"
|
ynh_app_setting_set "$app" domain "$domain"
|
||||||
ynh_app_setting_set "$app" final_path "$final_path"
|
ynh_app_setting_set "$app" final_path "$final_path"
|
||||||
ynh_app_setting_set "$app" service_name "$service_name"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@@ -33,8 +33,6 @@ ynh_print_info "Loading installation settings..."
|
|||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
service_name=$(ynh_app_setting_get $app service_name)
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP AND REMOVE SERVICES
|
# STOP AND REMOVE SERVICES
|
||||||
|
@@ -26,8 +26,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
path_url=$(ynh_app_setting_get $app path)
|
path_url=$(ynh_app_setting_get $app path)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
service_name=$(ynh_app_setting_get $app service_name)
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@@ -20,10 +20,6 @@ domain=$(ynh_app_setting_get $app domain)
|
|||||||
path_url=$(ynh_app_setting_get $app path)
|
path_url=$(ynh_app_setting_get $app path)
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
server_name=$(ynh_app_setting_get $app server_name)
|
|
||||||
service_name=$(ynh_app_setting_get $app service_name)
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIAL UPGRADE FOR VERSIONS < 1.2.0
|
# SPECIAL UPGRADE FOR VERSIONS < 1.2.0
|
||||||
@@ -42,12 +38,6 @@ if [ -f /etc/php5/fpm/pool.d/vpnadmin.conf ]; then
|
|||||||
fi
|
fi
|
||||||
test -d /var/www/vpnadmin && mv /var/www/vpnadmin /var/www/${app}
|
test -d /var/www/vpnadmin && mv /var/www/vpnadmin /var/www/${app}
|
||||||
|
|
||||||
if [ -z $service_name ]; then
|
|
||||||
service_name="ynh-vpnclient"
|
|
||||||
service_checker_name=$service_name"-checker"
|
|
||||||
ynh_app_setting_set "$app" service_name "$service_name"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Versions known to have a buggy backup script
|
## Versions known to have a buggy backup script
|
||||||
#buggy_versions="1.0.0 1.0.1 1.1.0"
|
#buggy_versions="1.0.0 1.0.1 1.1.0"
|
||||||
#curr_version=$(read_manifest version)
|
#curr_version=$(read_manifest version)
|
||||||
@@ -101,19 +91,9 @@ systemctl reload nginx
|
|||||||
### Make sure that the yunohost services have a description and need-lock enabled
|
### Make sure that the yunohost services have a description and need-lock enabled
|
||||||
|
|
||||||
# main service
|
# main service
|
||||||
|
|
||||||
if service_is_managed_by_yunohost $service_name
|
|
||||||
then
|
|
||||||
yunohost service remove $service_name
|
|
||||||
fi
|
|
||||||
yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock
|
yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock
|
||||||
|
|
||||||
# checker service
|
# checker service
|
||||||
|
|
||||||
if service_is_managed_by_yunohost $service_checker_name
|
|
||||||
then
|
|
||||||
yunohost service remove $service_checker_name
|
|
||||||
fi
|
|
||||||
yunohost service add $service_checker_name --description "Makes sure that the VPN service is running" --need_lock
|
yunohost service add $service_checker_name --description "Makes sure that the VPN service is running" --need_lock
|
||||||
|
|
||||||
# Reload systemd configuration
|
# Reload systemd configuration
|
||||||
|
Reference in New Issue
Block a user