mirror of
https://github.com/YunoHost-Apps/snserver_ynh.git
synced 2024-09-03 20:26:22 +02:00
Fix: scripts
This commit is contained in:
parent
437d1c023b
commit
7d74550566
5 changed files with 14 additions and 4 deletions
|
@ -15,6 +15,12 @@ pkg_dependencies=""
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
|
||||||
|
# Reset failed systemd services.
|
||||||
|
ynh_reset_systemd(){
|
||||||
|
systemctl reset-failed
|
||||||
|
}
|
||||||
|
|
||||||
# Substitute/replace a string (or expression) by another in a file on a
|
# Substitute/replace a string (or expression) by another in a file on a
|
||||||
#
|
#
|
||||||
# usage: ynh_replace_string_occurrence --occurrence=occurrence --match_string=match_string --replace_string=replace_string --target_file=target_file
|
# usage: ynh_replace_string_occurrence --occurrence=occurrence --match_string=match_string --replace_string=replace_string --target_file=target_file
|
||||||
|
|
|
@ -82,6 +82,8 @@ ynh_remove_systemd_config --service="$app-files"
|
||||||
ynh_remove_systemd_config --service="$app-syncing-server"
|
ynh_remove_systemd_config --service="$app-syncing-server"
|
||||||
ynh_remove_systemd_config --service="$app-syncing-server-worker"
|
ynh_remove_systemd_config --service="$app-syncing-server-worker"
|
||||||
|
|
||||||
|
ynh_reset_systemd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MYSQL DATABASE
|
# REMOVE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -180,10 +180,10 @@ ynh_replace_string --match_string="^AUTH_SERVER_URL.*$" --replace_string="AUTH_S
|
||||||
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_auth_worker" --target_file="$config_auth_worker"
|
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_auth_worker" --target_file="$config_auth_worker"
|
||||||
# API-Gateway Port
|
# API-Gateway Port
|
||||||
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_api_gateway" --target_file="$config_api_gateway"
|
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_api_gateway" --target_file="$config_api_gateway"
|
||||||
ynh_replace_string_occurrence --occurrence="1" --match_string="^proxy_pass.*$" --replace_string="proxy_pass http://127.0.0.1:$port_api_gateway/;" --target_file="$config_nginx"
|
ynh_replace_string_occurrence --occurrence="1" --match_string="proxy_pass.*$" --replace_string="proxy_pass http://127.0.0.1:$port_api_gateway/;" --target_file="$config_nginx"
|
||||||
# Files Port
|
# Files Port
|
||||||
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_files" --target_file="$config_files"
|
ynh_replace_string --match_string="^PORT.*$" --replace_string="PORT=$port_files" --target_file="$config_files"
|
||||||
ynh_replace_string_occurrence --occurrence="2" --match_string="^proxy_pass.*$" --replace_string="proxy_pass http://127.0.0.1:$port_files/;" --target_file="$config_nginx"
|
ynh_replace_string_occurrence --occurrence="2" --match_string="proxy_pass.*$" --replace_string="proxy_pass http://127.0.0.1:$port_files/;" --target_file="$config_nginx"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
|
|
|
@ -230,12 +230,14 @@ then
|
||||||
ynh_script_progression --message="Removing old service..." --weight=1
|
ynh_script_progression --message="Removing old service..." --weight=1
|
||||||
yunohost service remove "$app-syncing-server-js"
|
yunohost service remove "$app-syncing-server-js"
|
||||||
ynh_remove_systemd_config --service="$app-syncing-server-js"
|
ynh_remove_systemd_config --service="$app-syncing-server-js"
|
||||||
|
ynh_reset_systemd
|
||||||
fi
|
fi
|
||||||
if ynh_exec_warn_less yunohost service status "$app-syncing-server-js-worker" >/dev/null
|
if ynh_exec_warn_less yunohost service status "$app-syncing-server-js-worker" >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing old service..." --weight=1
|
ynh_script_progression --message="Removing old service..." --weight=1
|
||||||
yunohost service remove "$app-syncing-server-js-worker"
|
yunohost service remove "$app-syncing-server-js-worker"
|
||||||
ynh_remove_systemd_config --service="$app-syncing-server-worker-js"
|
ynh_remove_systemd_config --service="$app-syncing-server-js-worker"
|
||||||
|
ynh_reset_systemd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove unneeded data
|
# Remove unneeded data
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
if [ ! -f .env ]
|
if [ ! -f .env ]
|
||||||
then
|
then
|
||||||
export $(cat cron.env | xargs)
|
export $(cat cron.env | grep -v -E "^#" | xargs)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILE_UPLOAD_BYTES_PER_MB=1048576
|
FILE_UPLOAD_BYTES_PER_MB=1048576
|
||||||
|
|
Loading…
Reference in a new issue