From 8af61e56ee0e7e1257f45a6c4c6d88dc777df44b Mon Sep 17 00:00:00 2001 From: Douze Baie <12b@distrilab.fr> Date: Fri, 14 Jun 2024 11:31:13 +0200 Subject: [PATCH] Fix $app variable substitution --- scripts/backup | 2 +- scripts/install | 10 +++++----- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/backup b/scripts/backup index f237759..4693a0b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -43,7 +43,7 @@ ynh_backup --src_path="/etc/sudoers.d/$app" # BACKUP THE IMPORTER PLUGIN POST APP INSTALL HOOK #================================================= -ynh_backup --src_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_backup --src_path="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/install b/scripts/install index 3373916..1645950 100755 --- a/scripts/install +++ b/scripts/install @@ -17,7 +17,7 @@ ynh_script_progression --message="Setting up source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir #================================================= @@ -103,9 +103,9 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer -ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" -chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh -chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2 @@ -146,7 +146,7 @@ fi # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir chmod g-rwx $install_dir/wakka.config.php diff --git a/scripts/remove b/scripts/remove index dce13b4..db4d6eb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -24,7 +24,7 @@ ynh_remove_fpm_config ynh_secure_remove --file="/etc/sudoers/$app" # Remove post app install hook -ynh_secure_remove --file="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_secure_remove --file="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 87d2b2d..d50e58d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -47,7 +47,7 @@ ynh_restore_file --origin_path="/etc/sudoers.d/$app" #================================================= ynh_script_progression --message="Restoring the app importer post app install hook..." -ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +ynh_restore_file --origin_path="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 6c1a048..1f794e5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then fi chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R ${app}:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -81,9 +81,9 @@ ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app # Add a post app install hook to sync the app importer -ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" -chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh -chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/${app}_sync_app_importer.sh # ToDo : Add importer config in wakka.config.php if it is not already there ? # if [ ??? ]; then @@ -100,7 +100,7 @@ popd # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app:www-data $install_dir +chown -R ${app}:www-data $install_dir chmod -R u=rwX,g=rX,o-rwx $install_dir chmod g-rwx $install_dir/wakka.config.php