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:
ericgaspar 2023-05-30 09:18:14 +02:00
parent c12ceec4bf
commit 956dd45fd6
3 changed files with 29 additions and 19 deletions

View file

@ -84,8 +84,8 @@ yunohost service add xftp --description="Messaging platform" --log="/var/log/$ap
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
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"
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name="xftp" --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT

View file

@ -58,8 +58,8 @@ yunohost service add xftp --description="Messaging platform" --log="/var/log/$ap
#=================================================
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"
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=xftp --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT

View file

@ -15,17 +15,6 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STORE SETTINGS
#=================================================
public_ip4="$(curl -s ip.yunohost.org)" || true
fingerprint=$(cat /etc/opt/simplex/fingerprint)
xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint)
ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4
ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint
ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -33,8 +22,8 @@ ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=xftp --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
ynh_systemd_action --service_name=xftp --action="stop" --log_path="systemd"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -67,6 +56,27 @@ chown -R $app:www-data "$install_dir"
chmod +x $install_dir/smp-server
chmod +x $install_dir/xftp-server
#=================================================
# SPECIFIC SETUP
#=================================================
public_ip4="$(curl -s ip.yunohost.org)" || true
ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4
if [ -z "/etc/opt/simplex-xftp/fingerprint" ]; then
pushd "$install_dir"
./xftp-server init --ip $public_ip4 --quota '20gb' --store-log --path $data_dir
popd
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"
chown -R $app:$app "/etc/opt/simplex"
chown -R $app:$app "/etc/opt/simplex-xftp"
fi
#=================================================
# ADD A CONFIGURATION
#=================================================
@ -94,8 +104,8 @@ yunohost service add xftp --description="Messaging platform" --log="/var/log/$ap
#=================================================
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"
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=xftp --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT