2020-10-31 14:18:46 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-02-28 12:03:57 +01:00
|
|
|
# INSTALL NODEJS
|
2020-10-31 14:18:46 +01:00
|
|
|
#=================================================
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Reinstalling NodeJS..."
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_nodejs_install
|
2020-10-31 14:18:46 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-02-28 12:03:57 +01:00
|
|
|
# START ELASTICSEARCH
|
2020-10-31 14:18:46 +01:00
|
|
|
#=================================================
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Starting elasticsearch..."
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-02-28 12:03:57 +01:00
|
|
|
systemctl enable elasticsearch.service --quiet
|
|
|
|
systemctl start elasticsearch.service
|
2020-10-31 14:18:46 +01:00
|
|
|
|
|
|
|
#=================================================
|
2021-04-09 23:48:21 +02:00
|
|
|
# RESTORE THE APP MAIN DIR
|
2020-10-31 14:18:46 +01:00
|
|
|
#=================================================
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Restoring the app main directory..."
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_restore "$install_dir"
|
2020-10-31 14:18:46 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-02-28 12:03:57 +01:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2020-10-31 14:18:46 +01:00
|
|
|
#=================================================
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Restoring system configurations related to $app..."
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_restore "/etc/systemd/system/$app.service"
|
2024-02-28 12:03:57 +01:00
|
|
|
systemctl enable "$app.service" --quiet
|
2024-08-31 22:34:54 +02:00
|
|
|
|
2024-02-28 12:03:57 +01:00
|
|
|
yunohost service add "$app" --description="$app search index daemon"
|
2022-01-07 04:00:37 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_restore "/etc/logrotate.d/$app"
|
2022-01-07 04:00:37 +01:00
|
|
|
|
2020-10-31 14:18:46 +01:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Reloading NGINX web server and $app's service..."
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Server listening on port"
|
2020-10-31 14:18:46 +01:00
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_systemctl --service=nginx --action=reload
|
2020-10-31 14:18:46 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 02:50:35 +02:00
|
|
|
ynh_script_progression "Restoration completed for $app"
|