From 81e92bc368fe36df11611937e01ad5e666becef6 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Sun, 20 May 2018 19:38:56 +0200 Subject: [PATCH] fix crontab handling : copy + security --- scripts/install | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 47529dd..e9bdb42 100644 --- a/scripts/install +++ b/scripts/install @@ -107,12 +107,21 @@ ynh_add_fpm_config # Add cron job #================================================= +# Path where crontab will be installed cron_path="/etc/cron.d/$app" -ynh_replace_string "__USER__" "$app" ../conf/cheky.cron -ynh_replace_string "__FINALPATH__" "$final_path" ../conf/cheky.cron -sudo cp ../conf/cheky.cron "$cron_path" + +# Copy crontab from package to Yunohost +sudo cp -a ../conf/cheky.cron "$cron_path" + +# Secure crontab +chown root: "$cron_path" sudo chmod 644 "$cron_path" +# Configure crontab +ynh_replace_string "__USER__" "$app" "$cron_path" +ynh_replace_string "__FINALPATH__" "$final_path" "$cron_path" + + #================================================= # SETUP APPLICATION WITH CURL #=================================================