From b3717cce49151d2a0d268194cd5d10568bd8d26e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 17 Jan 2021 11:17:18 +0100 Subject: [PATCH] Fix --- manifest.json | 2 +- scripts/install | 18 +++++++++++++----- scripts/remove | 4 ++-- sources/Coturn_config_rotate.sh | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 6fcf136..05886ff 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "version": "4.5.1.1~ynh1", "url": "https://github.com/coturn/coturn", - "license": "MIT", + "license": "", "maintainer": { "name": "", "email": "" diff --git a/scripts/install b/scripts/install index a988000..d4b34d8 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,17 @@ path_url="/" app=$YNH_APP_INSTANCE_NAME +#================================================= +# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS +#================================================= +ynh_script_progression --message="Validating installation parameters..." --weight=1 + +final_path=/opt/yunohost/$app +test ! -e "$final_path" || ynh_die --message="This path already contains a folder" + +# Register (book) web path +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url + #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -153,11 +164,8 @@ ynh_store_file_checksum --file="$coturn_config_path" # WARNING : theses command are used in INSTALL, UPGRADE # For any update do it in all files -script_path=/opt/yunohost/coturn -ynh_app_setting_set --app=$app --key=script_path --value=$script_path -mkdir $script_path -cp ../sources/Coturn_config_rotate.sh $script_path/Coturn_config_rotate.sh -chmod +x $script_path/Coturn_config_rotate.sh +cp ../sources/Coturn_config_rotate.sh $final_path/Coturn_config_rotate.sh +chmod +x $final_path/Coturn_config_rotate.sh #================================================= # SET COTURN CRON diff --git a/scripts/remove b/scripts/remove index 50b141c..f6f0ff7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,7 +22,7 @@ turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port) turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name -script_path=$(ynh_app_setting_get --app=$app --key=script_path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE @@ -76,7 +76,7 @@ ynh_remove_logrotate #================================================= # Remove coturn/Coturn_config_rotate.sh -ynh_secure_remove --file=$script_path +ynh_secure_remove --file=$final_path #================================================= # REMOVE CRON JOB diff --git a/sources/Coturn_config_rotate.sh b/sources/Coturn_config_rotate.sh index 9ac92e4..f1351d6 100644 --- a/sources/Coturn_config_rotate.sh +++ b/sources/Coturn_config_rotate.sh @@ -25,7 +25,7 @@ new_config_line=$(egrep "^external-ip=.*\$" "/etc/turnserver.conf") if [ "$old_config_line" != "$new_config_line" ] then - systemctl restart coturn.service + systemctl restart $app.service fi exit 0