Skip to content

Commit 487edcd

Browse files
committed
Add a file exists check before deleting it.
1 parent f4885b7 commit 487edcd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file.
55

66
### Bugfixes
77

8-
- Revert #1943 Fix possible error occur for v-rebuild-cron-jobs
8+
- Revert #1943 and rework it to fix possible errors occuring on v-rebuild-cron-jobs.
9+
- Fixed #1956 to prevent reset of defined webmail client.
910

1011
## [1.4.4] - Service release
1112

func/main.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,12 @@ sync_cron_jobs() {
611611
crontab="/var/spool/cron/$user"
612612
fi
613613

614-
# remove file
615-
rm -f $crontab
614+
# remove file if exists
615+
if [ -e "$crontab" ]; then
616+
rm -f $crontab
617+
fi
618+
619+
# touch new crontab file
616620
touch $crontab
617621

618622
if [ "$CRON_REPORTS" = 'yes' ]; then

0 commit comments

Comments
 (0)