1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/zeronet_ynh.git synced 2024-09-03 17:46:12 +02:00

Added ynh_add_systemd_config for adding datadir and fs_port

This commit is contained in:
anmol 2020-11-09 18:23:45 +05:30
parent e455ce0b50
commit f8885b3544
4 changed files with 7 additions and 9 deletions

View file

@ -28,9 +28,6 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
fs_port=$(ynh_app_setting_get --app=$app --key=fs_port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
# Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -120,8 +117,7 @@ fi
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "$app service" --others_var="$fs_port $datadir" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="/etc/systemd/system/${app}.service"
#=================================================
# START SYSTEMD SERVICE

View file

@ -190,8 +190,9 @@ ynh_script_progression --message="Integrating service in YunoHost..."
### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script
### - As well as the section "INTEGRATE SERVICE IN YUNOHOST" in the restore script
### - And the section "INTEGRATE SERVICE IN YUNOHOST" in the upgrade script
ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="$fs_port $datadir"
yunohost service add $app --description "$app service" --others_var="$fs_port $datadir" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
yunohost service add $app --description "$app service" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
### Additional options starting with 3.8:
###

View file

@ -101,7 +101,8 @@ systemctl enable $app.service
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "$app service" --others_var="$fs_port $datadir" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="$fs_port $datadir"
yunohost service add $app --description "$app service" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
#=================================================
# START SYSTEMD SERVICE

View file

@ -140,8 +140,8 @@ chown -R $app: $datadir
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "$app service" --others_var="$fs_port $datadir" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="$fs_port $datadir"
yunohost service add $app --description "$app service" --log "$datadir/log/debug-last.log" --needs_exposed_ports "$fs_port"
#=================================================
# START SYSTEMD SERVICE