diff options
Diffstat (limited to 'cron-sh')
-rw-r--r-- | cron-sh/functions.sh | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cron-sh/functions.sh b/cron-sh/functions.sh index 9592e36..61a54ec 100644 --- a/cron-sh/functions.sh +++ b/cron-sh/functions.sh @@ -45,28 +45,24 @@ function check_is_enabled() { check=$1 SCRIPT_DIR=$(dirname $0) if [ "a$check" = "ano" ]; then - echo no - return 0 + return 1 fi # check if the test is supposed to be executed on this run echo $SCRIPT_DIR | grep -q $check val=$? if [ "$val" = "0" ]; then - echo yes - return 1 + return 0 fi - # is it a manual check? - istty=$(tty -s) - if $istty && [ "$check" = "manual" ]; then - echo yes - return 1 + # is the check being run manually (e.g., it is not a crontab symlink?) + # NOTE: this only checks if the file is a symlink, assuming that the manual check + # is performed by running the /usr/share/msec/security.sh directly + if [ "$check" = "manual" -a ! -L $0 ]; then + return 0 fi - echo no - return 0 + return 1 } - Diffcheck() { TODAY="$1" YESTERDAY="$2" |