Skip to content

Commit 680c5d2

Browse files
committed
Merge pull request ovh#32 in STICKY/overthebox-feeds from fix_crontab to release/53
* commit 'd59f5183d3c6ea8e61a88ba2ef1755574385d9d7': check if overthebox deamon is running and fix postinstall script
2 parents 43adaff + d59f518 commit 680c5d2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Diff for: overthebox/defaults/crontab.defaults

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
#!/bin/sh
22

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
326

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
527
chmod 600 /etc/crontabs/root
628
chown root:root /etc/crontabs/root
729

0 commit comments

Comments
 (0)