peertube-search-index_ynh/scripts/restore
Éric Gaspar a659b91efe cleaning
2024-08-31 22:34:54 +02:00

55 lines
1.7 KiB
Bash

#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# INSTALL NODEJS
#=================================================
ynh_script_progression "Reinstalling NodeJS..."
ynh_nodejs_install
#=================================================
# START ELASTICSEARCH
#=================================================
ynh_script_progression "Starting elasticsearch..."
systemctl enable elasticsearch.service --quiet
systemctl start elasticsearch.service
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore "/etc/systemd/system/$app.service"
systemctl enable "$app.service" --quiet
yunohost service add "$app" --description="$app search index daemon"
ynh_restore "/etc/logrotate.d/$app"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Reloading NGINX web server and $app's service..."
ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Server listening on port"
ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Restoration completed for $app"