mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
Use = intead of space for helper args to avoid issue with parameter
This commit is contained in:
parent
fecffedd11
commit
2a2dd0c010
7 changed files with 16 additions and 16 deletions
|
@ -145,7 +145,7 @@ EOF
|
||||||
# Used by update_config_if_needed.sh hook
|
# Used by update_config_if_needed.sh hook
|
||||||
save_vars_current_value() {
|
save_vars_current_value() {
|
||||||
for var in $var_list_to_manage; do
|
for var in $var_list_to_manage; do
|
||||||
ynh_app_setting_set --app "$app" --key previous_$var --value "${!var}"
|
ynh_app_setting_set --app="$app" --key=previous_$var --value="${!var}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/$app/"
|
ynh_backup --src_path="/etc/$app/"
|
||||||
ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_backup --src_path "$nginx_status_conf"
|
ynh_backup --src_path="$nginx_status_conf"
|
||||||
|
|
||||||
ynh_print_info --message="Backing up code..."
|
ynh_print_info --message="Backing up code..."
|
||||||
ynh_backup --src_path $install_dir
|
ynh_backup --src_path=$install_dir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
@ -41,7 +41,7 @@ ynh_backup --src_path $install_dir
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path "/etc/systemd/system/$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP VARIOUS FILES
|
# BACKUP VARIOUS FILES
|
||||||
|
|
|
@ -39,7 +39,7 @@ ynh_add_jinja_config --template=monitorix.conf --destination=/etc/monitorix/moni
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
ynh_systemd_action --service_name="$app" --action=start --log_path 'systemd' --line_match ' - Ok, ready.'
|
ynh_systemd_action --service_name="$app" --action=start --log_path='systemd' --line_match=' - Ok, ready.'
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -44,7 +44,7 @@ mv /var/log/new_"${app}" /var/log/"${app}"
|
||||||
ynh_script_progression --message="Adding configurations related to $app..." --weight=1
|
ynh_script_progression --message="Adding configurations related to $app..." --weight=1
|
||||||
|
|
||||||
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"
|
||||||
|
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
@ -69,14 +69,14 @@ ynh_script_progression --message="Protecting directory..."
|
||||||
|
|
||||||
set_permission
|
set_permission
|
||||||
|
|
||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --log_path 'systemd' --line_match ' - Ok, ready.'
|
ynh_systemd_action --service_name="$app" --action="start" --log_path='systemd' --line_match=' - Ok, ready.'
|
||||||
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
||||||
ynh_systemd_action --service_name=nginx.service --action=restart
|
ynh_systemd_action --service_name=nginx.service --action=restart
|
||||||
save_vars_current_value
|
save_vars_current_value
|
||||||
|
|
|
@ -49,7 +49,7 @@ ynh_script_progression --message="Protecting directory..."
|
||||||
|
|
||||||
set_permission
|
set_permission
|
||||||
|
|
||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -58,7 +58,7 @@ ynh_use_logrotate --logfile "/var/log/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action=start --log_path 'systemd' --line_match ' - Ok, ready.'
|
ynh_systemd_action --service_name="$app" --action=start --log_path='systemd' --line_match=' - Ok, ready.'
|
||||||
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
||||||
ynh_systemd_action --service_name=nginx.service --action=restart
|
ynh_systemd_action --service_name=nginx.service --action=restart
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
|
@ -77,7 +77,7 @@ fi
|
||||||
ynh_script_progression --message="Upgrading configurations related to $app..." --weight=1
|
ynh_script_progression --message="Upgrading configurations related to $app..." --weight=1
|
||||||
|
|
||||||
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"
|
||||||
if "$phpfpm_installed"; then
|
if "$phpfpm_installed"; then
|
||||||
config_php_fpm
|
config_php_fpm
|
||||||
fi
|
fi
|
||||||
|
@ -104,14 +104,14 @@ ynh_script_progression --message="Protecting directory..."
|
||||||
|
|
||||||
set_permission
|
set_permission
|
||||||
|
|
||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action=restart --log_path=systemd --line_match ' - Ok, ready.'
|
ynh_systemd_action --service_name="$app" --action=restart --log_path=systemd --line_match=' - Ok, ready.'
|
||||||
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
# when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded
|
||||||
ynh_systemd_action --service_name=nginx.service --action=restart
|
ynh_systemd_action --service_name=nginx.service --action=restart
|
||||||
save_vars_current_value
|
save_vars_current_value
|
||||||
|
|
|
@ -76,13 +76,13 @@ if "$status_dirty"; then
|
||||||
emailreports_yearly_to="$(ynh_app_setting_get --app="$app" --key=emailreports_yearly_to)"
|
emailreports_yearly_to="$(ynh_app_setting_get --app="$app" --key=emailreports_yearly_to)"
|
||||||
|
|
||||||
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"
|
||||||
configure_db
|
configure_db
|
||||||
|
|
||||||
if "$phpfpm_installed"; then
|
if "$phpfpm_installed"; then
|
||||||
config_php_fpm
|
config_php_fpm
|
||||||
fi
|
fi
|
||||||
ynh_systemd_action --service_name="$app" --action=restart --log_path 'systemd' --line_match ' - Ok, ready.'
|
ynh_systemd_action --service_name="$app" --action=restart --log_path='systemd' --line_match=' - Ok, ready.'
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
save_vars_current_value
|
save_vars_current_value
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue