Skip to content

Commit

Permalink
fix watchdog cron.d-entry creation from within init.d script
Browse files Browse the repository at this point in the history
  • Loading branch information
pocki80 authored Oct 15, 2018
1 parent a7d6987 commit 4fa79ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions wizard-run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#
# EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
# Version [0903k/201810150]
# Version [0903k/20181015]
# ^-- previous line is used from bmk-webstatus-package as version identification, dont remove "Version "
#
# Github repository: https://github.com/vchrizz/ER-wizard-OLSRd_V1/
Expand Down Expand Up @@ -400,7 +400,7 @@ if [ -f $olsrd4init ] && [ $(grep -c "rm /etc/cron.d/olsrdwatchdog" $olsrd4init)
linenumber=$(($(grep -n 'start-stop-daemon --start --quiet' $olsrd4init | tail -n1 | cut -d":" -f1)+5))
sed -i $linenumber'i\
if [ ! -f /etc/cron.d/olsrdwatchdog ] &&\
[ -f /etc/default/olsrd ] && [ $(cat /etc/default/olsrd | cut -d "#" -f 1 | grep -c ''START_OLSRD=\"YES\"'') \\> 0 ] &&\
[ -f /etc/default/olsrd ] && [ $(cat /etc/default/olsrd | cut -d "#" -f 1 | grep -c '"'"'START_OLSRD=\"YES\"'"'"') \\> 0 ] &&\
[ $(cat /config/user-data/olsrd4.conf | cut -d "#" -f 1 | grep -c LoadPlugin.*olsrd_watchdog) \\> 0 ] &&\
[ -x /etc/olsrdwatchdog ] ; then\
echo "* * * * * root /etc/olsrdwatchdog >/dev/null 2>/dev/null" >/etc/cron.d/olsrdwatchdog\
Expand Down Expand Up @@ -19586,7 +19586,7 @@ UG=$(echo $(id -un):$(id -u) "("$(id -gn):$(id -g)")")' $olsrd4init
linenumber=$(($(grep -n 'start-stop-daemon --start --quiet' $olsrd4init | tail -n1 | cut -d":" -f1)+5))
sed -i $linenumber'i\
if [ ! -f /etc/cron.d/olsrdwatchdog ] &&\
[ -f /etc/default/olsrd ] && [ $(cat /etc/default/olsrd | cut -d "#" -f 1 | grep -c ''START_OLSRD=\"YES\"'') \\> 0 ] &&\
[ -f /etc/default/olsrd ] && [ $(cat /etc/default/olsrd | cut -d "#" -f 1 | grep -c '"'"'START_OLSRD=\"YES\"'"'"') \\> 0 ] &&\
[ $(cat /config/user-data/olsrd4.conf | cut -d "#" -f 1 | grep -c LoadPlugin.*olsrd_watchdog) \\> 0 ] &&\
[ -x /etc/olsrdwatchdog ] ; then\
echo "* * * * * root /etc/olsrdwatchdog >/dev/null 2>/dev/null" >/etc/cron.d/olsrdwatchdog\
Expand Down
4 changes: 2 additions & 2 deletions wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
Works on EdgeRouter and EdgeRouter X / X-SFP (system version 1.7.0+)
versioninfo=201810150
versioninfo=201810151
^-- use version identifier as number: YYYYMMDDX whereas X can be intraday-version
autoupdate=201810090
autoupdate=201810151
^-- set autoupdate the same version identifier to allow autoupdates
-->
Expand Down

0 comments on commit 4fa79ce

Please sign in to comment.