瀏覽代碼

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 8 年之前
父節點
當前提交
87f354e669
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5
    3
      src/freedombone-base-tripwire

+ 5
- 3
src/freedombone-base-tripwire 查看文件

139
 
139
 
140
        ' | reset-tripwire
140
        ' | reset-tripwire
141
 
141
 
142
-    TRIPWIRE_MIN=$((1 + RANDOM % 49))
143
-    TRIPWIRE_HOUR=$((1 + RANDOM % 6))
144
-    echo "${TRIPWIRE_MIN} ${TRIPWIRE_HOUR}              *   *   *   root /usr/sbin/tripwire -m c" /etc/crontab
142
+    if ! grep -q "tripwire" /etc/crontab; then
143
+        TRIPWIRE_MIN=$((1 + RANDOM % 49))
144
+        TRIPWIRE_HOUR=$((1 + RANDOM % 6))
145
+        echo "${TRIPWIRE_MIN} ${TRIPWIRE_HOUR}              *   *   *   root /usr/sbin/tripwire -m c" >> /etc/crontab
146
+    fi
145
 
147
 
146
     mark_completed $FUNCNAME
148
     mark_completed $FUNCNAME
147
 }
149
 }