1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simplex_ynh.git synced 2024-09-03 20:26:28 +02:00
This commit is contained in:
Éric Gaspar 2023-05-23 19:03:19 +02:00
parent 8ffa1c1076
commit c0009a1d2a
2 changed files with 15 additions and 22 deletions

View file

@ -13,8 +13,8 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
storage_quota="20gb"
ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota
#storage_quota="20gb"
#ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -45,13 +45,13 @@ pushd "$install_dir"
./xftp-server init --ip $public_ip4 --quota '20gb' --store-log --path $data_dir
popd
#fingerprint=$(cat /etc/opt/simplex/fingerprint)
#ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
fingerprint=$(cat /etc/opt/simplex/fingerprint)
ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
#xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)
#ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)
ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
#ynh_replace_string --match_string="port: 443" --replace_string="port: $port_xftp" --target_file="/etc/opt/simplex-xftp/file-server.ini"
ynh_replace_string --match_string="port: 443" --replace_string="port: $port_xftp" --target_file="/etc/opt/simplex-xftp/file-server.ini"
chown -R $app:$app "/etc/opt/simplex"
chown -R $app:$app "/etc/opt/simplex-xftp"
@ -59,12 +59,12 @@ chown -R $app:$app "/etc/opt/simplex-xftp"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
#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="../conf/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"
#chmod 400 "/etc/opt/simplex-xftp/file-server.ini"
#chown $app:$app "/etc/opt/simplex-xftp/file-server.ini"
#=================================================
# SYSTEM CONFIGURATION
@ -87,13 +87,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name="xftp" --action="start" --log_path="/var/log/$app/$app.log"
fingerprint=$(cat /etc/opt/simplex/fingerprint)
ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)
ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -41,10 +41,10 @@ ynh_systemd_action --service_name=xftp --action="stop" --log_path="/var/log/$app
#=================================================
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