From 442fdb01803f505d817b8ef4c3dff8ee8878621f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 26 Jul 2021 10:17:25 +0200 Subject: [PATCH] Add_config --- conf/cron | 1 + conf/invoiceninja.cron | 1 - scripts/install | 11 +++-------- scripts/upgrade | 12 ------------ 4 files changed, 4 insertions(+), 21 deletions(-) create mode 100644 conf/cron delete mode 100644 conf/invoiceninja.cron diff --git a/conf/cron b/conf/cron new file mode 100644 index 0000000..8100d34 --- /dev/null +++ b/conf/cron @@ -0,0 +1 @@ +* * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/artisan schedule:run >> /dev/null 2>&1 diff --git a/conf/invoiceninja.cron b/conf/invoiceninja.cron deleted file mode 100644 index 4759b32..0000000 --- a/conf/invoiceninja.cron +++ /dev/null @@ -1 +0,0 @@ -* * * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ __DESTDIR__/artisan schedule:run >> /dev/null 2>&1 diff --git a/scripts/install b/scripts/install index cc31d86..0b6fc37 100755 --- a/scripts/install +++ b/scripts/install @@ -167,14 +167,9 @@ popd #================================================= ynh_script_progression --message="Adding a cron job..." -cron_path="/etc/cron.d/$app" -cp -a ../conf/invoiceninja.cron "$cron_path" -chown root: "$cron_path" -chmod 644 "$cron_path" - -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path" -ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 6559530..96f7a88 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,18 +62,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================