From 3d1d93cc3095e92f1a6ae8c3a486f2969e17e2d2 Mon Sep 17 00:00:00 2001 From: asandikci Date: Sun, 7 Jan 2024 12:47:50 +0300 Subject: [PATCH] update permissions and crontab --- scripts/install | 4 +++- scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c205524..4c6d11a 100755 --- a/scripts/install +++ b/scripts/install @@ -153,9 +153,11 @@ ynh_add_config --template="../conf/config.php" --destination="$install_dir/confi chmod 400 "$install_dir/config.php" chown $app:$app "$install_dir/config.php" -chmod -R 600 "$install_dir/src/" +chmod -R 700 "$install_dir/src/" chown -R $app:$app "$install_dir/src/" +crontab -l | { cat; echo "*/10 * * * * php -r \"require '/var/www/$app/src/server.php'; updateRemoteData(); \""; } | crontab - + ### For more complex cases where you want to replace stuff using regexes, ### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) ### When doing so, you also need to manually call ynh_store_file_checksum diff --git a/scripts/upgrade b/scripts/upgrade index 4c14e2f..9423b22 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,6 +120,9 @@ ynh_add_config --template="../conf/config.php" --destination="$install_dir/confi chmod 400 "$install_dir/config.php" chown $app:$app "$install_dir/config.php" +chmod -R 700 "$install_dir/src/" +chown -R $app:$app "$install_dir/src/" + ### For more complex cases where you want to replace stuff using regexes, ### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) ### When doing so, you also need to manually call ynh_store_file_checksum