From 4a5a553c8c6cefaae4edc099d36df209395b127d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20W=C3=BChr?= Date: Fri, 24 Feb 2023 14:34:46 +0100 Subject: [PATCH] not again --- scripts/_common.sh | 11 ++--------- scripts/backup | 2 +- scripts/change_url | 2 +- scripts/install | 6 +++--- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9aee0dc..6335095 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,20 +8,13 @@ # PERSONAL HELPERS #================================================= ntfy_setup_source() { - # $YNH_ARCH=$1 - # $install_dir=$2 - ynh_setup_source -d "$install_dir" -a "$YNH_ARCH" - ynh_secure_remove --file=$install_dir/client - ynh_secure_remove --file=$install_dir/server - + ynh_secure_remove -f "$install_dir/client" + ynh_secure_remove -f "$install_dir/server" mkdir -p "$install_dir/data" } ntfy_fix_permissions() { - # $app=$1 - # $install_dir=$2 - chmod o+w "$install_dir/data" chmod 400 "$install_dir/server.yml" chown $app:$app "$install_dir/server.yml" diff --git a/scripts/backup b/scripts/backup index 93654c3..690d747 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,7 @@ #!/bin/bash -source /usr/share/yunohost/helpers source ../settings/scripts/_common.sh +source /usr/share/yunohost/helpers ynh_backup -s "$install_dir" ynh_backup -s "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/change_url b/scripts/change_url index dd77415..bb25bcd 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,7 @@ #!/bin/bash -source /usr/share/yunohost/helpers source _common.sh +source /usr/share/yunohost/helpers ynh_script_progression -m "Updating systemd service..." -w 1 ynh_add_systemd_config diff --git a/scripts/install b/scripts/install index 9bd6d2f..5ad1df4 100755 --- a/scripts/install +++ b/scripts/install @@ -1,10 +1,10 @@ #!/bin/bash -source /usr/share/yunohost/helpers source _common.sh +source /usr/share/yunohost/helpers ynh_script_progression -m "Setting up source files..." -w 6 -ntfy_setup_src $YNH_ARCH $install_dir +ntfy_setup_src ynh_script_progression -m "Configuring web server..." -w 2 ynh_add_nginx_config @@ -16,7 +16,7 @@ ynh_script_progression -m "Adding a command wrapper..." -w 1 ynh_add_config -t "ntfy.sh" -d "$install_dir/ntfy.sh" ynh_script_progression -m "Fixing file permissions..." -w 1 -ntfy_fix_permissions $install_dir $app +ntfy_fix_permissions ynh_script_progression -m "Configuring systemd service..." -w 1 ynh_add_systemd_config diff --git a/scripts/remove b/scripts/remove index 83790f0..150241b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,7 @@ #!/bin/bash -source /usr/share/yunohost/helpers source _common.sh +source /usr/share/yunohost/helpers ynh_script_progression -m "Removing service in YunoHost..." -w 1 yunohost service remove $app diff --git a/scripts/restore b/scripts/restore index 478063e..5962cc2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -7,7 +7,7 @@ ynh_script_progression -m "Restoring the main directory..." -w 1 ynh_restore_file -o "$install_dir" ynh_script_progression -m "Fixing file permissions..." -w 1 -ntfy_fix_permissions $app $install_dir +ntfy_fix_permissions ynh_script_progression -m "Restoring the web server configuration..." -w 1 ynh_restore_file -o "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 4589f91..8fa9e67 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,7 +9,7 @@ upgrade_type=$(ynh_check_app_version_changed) if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression -m "Upgrading source files..." -w 1 - ntfy_setup_source $YNH_ARCH $install_dir + ntfy_setup_source fi ynh_script_progression -m "Upgrading web server configuration..." -w 2