From d5cb594fb3e6abba51dbde7cac2252fabc0bdfd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 15 Jan 2024 23:10:39 +0100 Subject: [PATCH] Cleanup, fix password not saved in db --- scripts/install | 9 ++++++++- scripts/remove | 6 +++--- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index dc77826..6d66241 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,13 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INITIALIZE AND STORE SETTINGS +#================================================= + +# Passwords are not saved by default. +ynh_app_setting_set --app="$app" --key=password --value="$password" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -45,7 +52,7 @@ ynh_script_progression --message="Adding system configurations related to $app.. # Create a dedicated NGINX config ynh_add_nginx_config -yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports $port_stream +yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index dac0d28..65417f3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,9 +16,9 @@ source /usr/share/yunohost/helpers #================================================= # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null; then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + ynh_script_progression --message="Removing "$app" service integration..." --weight=1 + yunohost service remove "$app" fi #================================================= diff --git a/scripts/restore b/scripts/restore index e5496aa..6590800 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,7 +45,7 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports $port_stream +yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 940714a..93c75ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,7 +59,7 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config ynh_add_nginx_config -yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports $port_stream +yunohost service add "$app" --description="TV streaming server and recorder" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE