Skip to content

Commit 16760b9

Browse files
committed
[type/__cron*] Check if crontab(1) is available
On at least Synology DSM, although there is a crond, the crontab(1) command is missing. Check for it and produce an error if it is not present.
1 parent b5ca8d1 commit 16760b9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

type/__cron/explorer/cron-allowed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh -e
22
#
3-
# 2022 Dennis Camera (dennis.camera at riiengineering.ch)
3+
# 2022,2025 Dennis Camera (dennis.camera at riiengineering.ch)
44
#
55
# This file is part of skonfig-base.
66
#
@@ -25,6 +25,11 @@ cron_fail() { printf '%s\n' "$1" >&2; exit "$2"; }
2525

2626
user=$(cat "${__object:?}/parameter/user")
2727

28+
command -v crontab >/dev/null 2>&1 || {
29+
echo 'Cannot find crontab(1). This type does not work without it.' >&2
30+
exit 1
31+
}
32+
2833
case $(uname -s)
2934
in
3035
(SunOS)

0 commit comments

Comments
 (0)