File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+ FILE=" /etc/crontabs/root"
4
+
5
+ CMD=" /usr/bin/overthebox_download_recovery"
6
+ if [ " $( grep " $CMD " $FILE -c ) " != " 1" ]
7
+ then
8
+ TMP=$( mktemp)
9
+ # cleanup
10
+ grep -v " $CMD " $FILE > $TMP
11
+ # fix
12
+ echo ' 00 02 * * 0 { /bin/sleep $(( $(tr -cd 0-9 </dev/urandom | head -c 3) * 7 )) && /usr/bin/overthebox_download_recovery; } &>/dev/null' >> $TMP
13
+ mv $TMP $FILE
14
+ fi
15
+
16
+ CMD=" /usr/bin/overtheboxd"
17
+ if [ " $( grep " $CMD " $FILE -c ) " != " 1" ]
18
+ then
19
+ TMP=$( mktemp)
20
+ # cleanup
21
+ grep -v " $CMD " $FILE > $TMP
22
+ # fix
23
+ echo ' 00 */2 * * * { pgrep -f "lua /usr/bin/overtheboxd" 2>&1 1>/dev/null || /etc/init.d/overtheboxd restart; } &>/dev/null' >> $TMP
24
+ mv $TMP $FILE
25
+ fi
3
26
4
- echo ' 00 02 * * 0 { /bin/sleep $(( $(tr -cd 0-9 </dev/urandom | head -c 3) * 7 )) && /usr/bin/overthebox_download_recovery; } &>/dev/null' >> /etc/crontabs/root
5
27
chmod 600 /etc/crontabs/root
6
28
chown root:root /etc/crontabs/root
7
29
You can’t perform that action at this time.
0 commit comments