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/*)"
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
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
#=================================================ç
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=nginx_status.conf --destination="$nginx_status_conf"
@ -62,6 +52,14 @@ fi
configure_hooks
configure_alerts_email
#=================================================
# STANDARD MODIFICATIONS
#=================================================
ynh_script_progression --message="Installing packages..." --weight=1
# Download package and install it
install_monitorix_package
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -12,17 +12,6 @@ source ../settings/scripts/experimental_helper.sh
source /usr/share/yunohost/helpers
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..."
configure_db
@ -32,15 +21,23 @@ configure_db
ynh_script_progression --message="Restoring files" --weight=1
ynh_restore
mkdir -p /var/log/$app
systemctl enable $app.service --quiet
mkdir -p /var/log/"$app"
systemctl enable "$app".service --quiet
ynh_script_progression --message="Configuring php fpm access if needed..."
if "$phpfpm_installed"; then
config_php_fpm
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