From 27e955bf5cedbb3162fb6a222a6cc36b7841625d Mon Sep 17 00:00:00 2001 From: sandb Date: Fri, 17 Dec 2010 00:06:16 +0100 Subject: [PATCH] cron stuff adapted --- scanner/pamela-scanner.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 scanner/pamela-scanner.sh diff --git a/scanner/pamela-scanner.sh b/scanner/pamela-scanner.sh old mode 100644 new mode 100755 index e6dfd4e..f5682c1 --- a/scanner/pamela-scanner.sh +++ b/scanner/pamela-scanner.sh @@ -24,7 +24,6 @@ LICENSE PAM_DIR="$(cd $(dirname $0) && pwd)" PAM_CRON="/etc/cron.d/pamela" PAM_SCRIPT="$PAM_DIR/$(basename $0)" -PAM_LOG="$PAM_DIR/pamela.log" REGISTER= @@ -70,13 +69,15 @@ function register { check_if_root check_if_arpscan_installed echo "Registering pamela in cron: $PAM_CRON" - echo "*/2 * * * * root [ -x \"$PAM_SCRIPT\" ] && \"$PAM_SCRIPT\" -i \"$IF\" -o \"$OUT\" -u \"$USER\" -p \"$PASSWORD\" >> \"$PAM_LOG\"" > "$PAM_CRON" + echo "*/2 * * * * [ -x \"$PAM_SCRIPT\" ] && \"$PAM_SCRIPT\" -i \"$IF\" -o \"$OUT\" -u \"$USER\" -p \"$PASSWORD\" | logger -t pamela" > "$PAM_CRON" + echo "Depending on your version of crond, you might have to restart the cron daemon for the changes to take effect" } function unregister { check_if_root echo "Unregistering pamela in cron: $PAM_CRON" rm "$PAM_CRON" + echo "Depending on your version of crond, you might have to restart the cron daemon for the changes to take effect" } function parse_params { @@ -116,8 +117,7 @@ function scan_and_upload { let "NUM_DATA=NUM_DATA+1" done POST="data=$DATA" - echo wget "$OUT" -O - --quiet --post-data "$POST" --user "$USER" --password "$PASSWORD" || echo "wget error: $?" - RESULT=$(wget "$OUT" -O - --post-data "$POST" --user "$USER" --password "$PASSWORD") + RESULT=$(wget "$OUT" -O - --quiet --post-data "$POST" --user "$USER" --password "$PASSWORD") if [ -n "$RESULT" ] then echo Error uploading results: