From e1830024d3f0133a1e75f409d229b6becc846084 Mon Sep 17 00:00:00 2001 From: mastereur <22839524+mastereur@users.noreply.github.com> Date: Wed, 30 Nov 2022 08:31:35 +0100 Subject: [PATCH] Add check for install.lock file #87 --- scripts/install | 6 ++++++ scripts/upgrade | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index db105ea..5f72bf4 100644 --- a/scripts/install +++ b/scripts/install @@ -250,6 +250,12 @@ ynh_store_file_checksum --file="$final_path/htdocs/conf/conf.php" ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files +if [ ! -f $datadir/install.lock ]; then + echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" + chown $app:$app "$datadir/install.lock" + chmod 440 "$datadir/install.lock" +fi + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index cc68717..2d34b7d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -303,6 +303,12 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Configuring permissions..." --weight=1 # Set permissions on app files +if [ ! -f $datadir/install.lock ]; then + echo 'This is a lock file to prevent use of install pages (set with permission 440)' > "$datadir/install.lock" + chown $app:$app "$datadir/install.lock" + chmod 440 "$datadir/install.lock" +fi + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path"