mirror of
https://github.com/YunoHost-Apps/mautrix_discord_ynh.git
synced 2024-09-03 19:36:35 +02:00
Fix restore script
This commit is contained in:
parent
63f7526c04
commit
b90a212c01
1 changed files with 13 additions and 6 deletions
|
@ -49,15 +49,25 @@ chown $app:$app "$install_dir/config.yaml"
|
|||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=3
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
yunohost service add $app --description="Matrix Discord pupetting bridge for YunoHost" --log="/var/log/$app/$app.log"
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="Matrix Discord pupetting bridge for YunoHost" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -65,15 +75,12 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Reloading $app's service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
# Wait until the synapse user is created
|
||||
sleep 30
|
||||
# (Note that, by default, non-admins might not have your homeserver's permission to create communities.)
|
||||
if [ "$bot_synapse_adm" = true ]
|
||||
then
|
||||
ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = ""$botname"";"
|
||||
fi
|
||||
ynh_systemd_action --service_name=$app --action="restart"
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
Loading…
Add table
Reference in a new issue