From 476b92778d66e9221a78d1f6fad8e7386a1b818f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 8 May 2024 14:22:51 +0200 Subject: [PATCH] add quota --- scripts/install | 4 ++-- scripts/upgrade | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index e67f1dc..b102f16 100755 --- a/scripts/install +++ b/scripts/install @@ -42,7 +42,7 @@ ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 pushd "$install_dir" ./smp-server init --no-password --ip $public_ip4 --store-log --yes - ./xftp-server init --ip $public_ip4 --quota '20gb' --store-log --path $data_dir + ./xftp-server init --ip $public_ip4 --quota '$storage_quota' --store-log --path $data_dir popd fingerprint=$(cat /etc/opt/simplex/fingerprint) @@ -61,7 +61,7 @@ ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini" +ynh_add_config --template="file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini" chmod 400 "/etc/opt/simplex-xftp/file-server.ini" chown $app:$app "/etc/opt/simplex-xftp/file-server.ini" diff --git a/scripts/upgrade b/scripts/upgrade index daeef2d..cda4c80 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,10 +24,10 @@ ynh_systemd_action --service_name=xftp --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -#if [ -z "${storage_quota:-}" ]; then -# storage_quota="20gb" -# ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota -#fi +if [ -z "${storage_quota:-}" ]; then + storage_quota="20gb" + ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota +fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -55,7 +55,7 @@ if [ ! -d /etc/opt/simplex-xftp ]; then ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 pushd "$install_dir" - ./xftp-server init --ip $public_ip4 --quota '20gb' --store-log --path $data_dir + ./xftp-server init --ip $public_ip4 --quota '$storage_quota' --store-log --path $data_dir popd xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)