From f470ce4365b0980d613fb5e209f1b2463a16367f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 May 2024 10:32:11 +0200 Subject: [PATCH] cleaning --- manifest.toml | 2 -- scripts/install | 13 +++---------- scripts/restore | 11 +---------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/manifest.toml b/manifest.toml index 093d9f2..d59c3b1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,8 +41,6 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] - - [resources.data_dir] [resources.ports] diff --git a/scripts/install b/scripts/install index b1394cc..97acc49 100755 --- a/scripts/install +++ b/scripts/install @@ -70,9 +70,9 @@ cjdns_ipv6=$(jq -r '.ipv6' < $install_dir/cjdroute.conf) ynh_app_setting_set --app=$app --key=cjdns_ipv6 --value=$cjdns_ipv6 #================================================= -# SETUP SYSTEMD +# APP INITIAL CONFIGURATION #================================================= -ynh_script_progression --message="Configuring systemd service..." +ynh_script_progression --message="Adding $app's configuration files..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -80,19 +80,12 @@ ynh_add_systemd_config # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - yunohost service add $app --description="Encrypted IPv6 network" --log="/var/log/$app/$app.log" -#================================================= -# GENERIC FINALIZATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Launching cjdns service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" diff --git a/scripts/restore b/scripts/restore index 9a91205..078501a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,19 +19,10 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 - -ynh_restore_file --origin_path="$data_dir" --not_mandatory - -# (Same as for install dir) -chown -R $app:www-data "$data_dir" - #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet