1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00

Fix install/restore

This commit is contained in:
Josué Tille 2024-04-27 00:19:40 +02:00
parent c6e02effdf
commit 8189565ae8
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5
2 changed files with 20 additions and 25 deletions

View file

@ -25,24 +25,14 @@ if [ -n "$(ls -A $data_dir)" ]; then
app_data_dirs="$(echo /home/yunohost.app/*)" app_data_dirs="$(echo /home/yunohost.app/*)"
fi fi
#=================================================
# STANDARD MODIFICATIONS
#=================================================
ynh_script_progression --message="Installing packages..." --weight=1
# Download package and install it
install_monitorix_package
ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15 ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15
mkdir -p /var/log/new_"${app}"
mv -t /var/log/new_"${app}" /var/log/monitorix*
mv /var/log/new_"${app}" /var/log/"${app}"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#=================================================ç #=================================================ç
ynh_script_progression --message="Adding configurations related to $app..." --weight=1 ynh_script_progression --message="Adding configurations related to $app..." --weight=1
mkdir -p /etc/monitorix
ynh_add_jinja_config --template=monitorix.conf --destination="/etc/monitorix/monitorix.conf" ynh_add_jinja_config --template=monitorix.conf --destination="/etc/monitorix/monitorix.conf"
ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf" ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf"
@ -62,6 +52,14 @@ fi
configure_hooks configure_hooks
configure_alerts_email configure_alerts_email
#=================================================
# STANDARD MODIFICATIONS
#=================================================
ynh_script_progression --message="Installing packages..." --weight=1
# Download package and install it
install_monitorix_package
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -12,17 +12,6 @@ source ../settings/scripts/experimental_helper.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
load_vars load_vars
#=================================================
# RESTORE THE DEPENDENCIES
#=================================================
ynh_script_progression --message="Restoring the dependencies..." --weight=1
install_monitorix_package
ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15
mkdir -p /var/log/new_"${app}"
mv -t /var/log/new_"${app}" /var/log/monitorix*
mv /var/log/new_"${app}" /var/log/"${app}"
ynh_script_progression --message="Configuring databases access..." ynh_script_progression --message="Configuring databases access..."
configure_db configure_db
@ -32,15 +21,23 @@ configure_db
ynh_script_progression --message="Restoring files" --weight=1 ynh_script_progression --message="Restoring files" --weight=1
ynh_restore ynh_restore
mkdir -p /var/log/$app mkdir -p /var/log/"$app"
systemctl enable $app.service --quiet systemctl enable "$app".service --quiet
ynh_script_progression --message="Configuring php fpm access if needed..." ynh_script_progression --message="Configuring php fpm access if needed..."
if "$phpfpm_installed"; then if "$phpfpm_installed"; then
config_php_fpm config_php_fpm
fi fi
yunohost service add $app --description="Monitorix" --log="systemd" yunohost service add "$app" --description="Monitorix" --log="systemd"
#=================================================
# RESTORE THE DEPENDENCIES
#=================================================
ynh_script_progression --message="Restoring the dependencies..." --weight=1
install_monitorix_package
ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION