mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
Fix shell check
This commit is contained in:
parent
6b8ba66da9
commit
595caa2dc9
6 changed files with 14 additions and 14 deletions
|
@ -149,7 +149,7 @@ EOF
|
|||
# Used by update_config_if_needed.sh hook
|
||||
save_vars_current_value() {
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ load_vars
|
|||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
if systemctl is-active $app.service --quiet; then
|
||||
if systemctl is-active "$app".service --quiet; then
|
||||
ynh_print_warn --message="It's highly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'"
|
||||
fi
|
||||
|
||||
|
@ -33,7 +33,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
ynh_backup --src_path="$nginx_status_conf"
|
||||
|
||||
ynh_print_info --message="Backing up code..."
|
||||
ynh_backup --src_path=$install_dir
|
||||
ynh_backup --src_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
|
|
@ -18,7 +18,7 @@ load_vars
|
|||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
|
|
|
@ -17,10 +17,10 @@ ensure_vars_set
|
|||
# Check datadir empty
|
||||
#=================================================
|
||||
|
||||
if [ -n "$(ls -A $data_dir)" ]; then
|
||||
if [ -n "$(ls -A "$data_dir")" ]; then
|
||||
old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')"
|
||||
ynh_print_warn --message="Data directory was not empty. Data was moved to $old_data_dir_path"
|
||||
mkdir -p $old_data_dir_path
|
||||
mkdir -p "$old_data_dir_path"
|
||||
mv -t "$old_data_dir_path" "$data_dir"/*
|
||||
app_data_dirs="$(echo /home/yunohost.app/*)"
|
||||
fi
|
||||
|
|
|
@ -18,7 +18,7 @@ load_vars
|
|||
#=================================================
|
||||
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||
if ynh_exec_warn_less yunohost service status "$app" >/dev/null
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service integration..." --weight=3
|
||||
yunohost service remove "$app"
|
||||
|
@ -48,11 +48,11 @@ for pool_dir_by_version in /etc/php/*; do
|
|||
fi
|
||||
done
|
||||
|
||||
if ynh_psql_user_exists --user=$db_user; then
|
||||
ynh_psql_drop_user $db_user
|
||||
if ynh_psql_user_exists --user="$db_user"; then
|
||||
ynh_psql_drop_user "$db_user"
|
||||
fi
|
||||
if ynh_mysql_user_exists --user=$db_user; then
|
||||
ynh_mysql_drop_user $db_user
|
||||
if ynh_mysql_user_exists --user="$db_user"; then
|
||||
ynh_mysql_drop_user "$db_user"
|
||||
fi
|
||||
|
||||
ynh_package_autopurge monitorix
|
||||
|
|
|
@ -11,7 +11,7 @@ source experimental_helper.sh
|
|||
source /usr/share/yunohost/helpers
|
||||
load_vars
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
upgrade_type="$(ynh_check_app_version_changed)"
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
|
@ -30,14 +30,14 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|||
test -e /etc/monitorix/conf.d/00-debian.conf || touch /etc/monitorix/conf.d/00-debian.conf
|
||||
|
||||
# Remove old hook if exist
|
||||
ynh_secure_remove --file=/usr/share/yunohost/hooks/post_iptable_rules/50-$app
|
||||
ynh_secure_remove --file=/usr/share/yunohost/hooks/post_iptable_rules/50-"$app"
|
||||
|
||||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app" --action=stop --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
||||
|
|
Loading…
Add table
Reference in a new issue