From 55e15cf2f4fd5abafd4f9b9f156eaeb7d756af83 Mon Sep 17 00:00:00 2001 From: Christian Fenzl Date: Tue, 6 Mar 2018 01:43:51 +0100 Subject: [PATCH] Fixed deletion of old cron jobs --- postinstall.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/postinstall.sh b/postinstall.sh index 092e914..2b1dfb8 100644 --- a/postinstall.sh +++ b/postinstall.sh @@ -33,24 +33,27 @@ if [ ! -e REPLACELBPLOGDIR ]; then mkdir -p REPLACELBPLOGDIR fi -if [ -e "$LBHOMEDIR/system/cron/cron.daily/$2*" ]; then +rm $LBHOMEDIR/system/cron/cron.daily/$2* >/dev/null +if [ $? -eq 0 ]; then echo " Deleting old daily schedules" - rm -f $LBHOMEDIR/system/cron/cron.daily/$2* UPGRADE=1 fi -if [ -e "$LBHOMEDIR/system/cron/cron.weekly/$2*" ]; then + +rm -f $LBHOMEDIR/system/cron/cron.weekly/$2* +if [ $? -eq 0 ]; then echo " Deleting old weekly schedules" - rm -f $LBHOMEDIR/system/cron/cron.weekly/$2* UPGRADE=1 fi -if [ -e "$LBHOMEDIR/system/cron/cron.monthly/$2*" ]; then + +rm -f $LBHOMEDIR/system/cron/cron.monthly/$2* +if [ $? -eq 0 ]; then echo " Deleting old monthly schedules" - rm -f $LBHOMEDIR/system/cron/cron.monthly/$2* UPGRADE=1 fi -if [ -e "$LBHOMEDIR/system/cron/cron.yearly/$2*" ]; then + +rm -f $LBHOMEDIR/system/cron/cron.yearly/$2* +if [ $? -eq 0 ]; then echo " Deleting old yearly schedules ($LBHOMEDIR/system/cron/cron.yearly/$2*) " - rm -f $LBHOMEDIR/system/cron/cron.yearly/$2* UPGRADE=1 fi