2015-01-15 17:35:55 -07:00
|
|
|
#!/bin/sh
|
2015-01-18 12:36:49 -07:00
|
|
|
<<'LICENSE'
|
|
|
|
Part of BBHN Mesh -- Used for creating Amateur Radio friendly mesh networks
|
|
|
|
Copyright (C) 2015 Conrad Lara
|
|
|
|
See Contributors file for additional contributors
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation version 3 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
LICENSE
|
|
|
|
|
2013-11-14 23:11:16 -07:00
|
|
|
|
2015-01-15 17:35:55 -07:00
|
|
|
# wait for the watchdog file to appear before starting
|
|
|
|
while [ ! -f "/tmp/olsrd.watchdog" ]
|
|
|
|
do
|
|
|
|
sleep 15
|
|
|
|
done
|
2014-11-03 20:59:34 -07:00
|
|
|
|
2013-11-14 23:11:16 -07:00
|
|
|
|
2015-01-15 17:35:55 -07:00
|
|
|
while true
|
|
|
|
do
|
2013-11-14 23:11:16 -07:00
|
|
|
|
2015-01-15 17:35:55 -07:00
|
|
|
if [ -f "/tmp/olsrd.watchdog" ]
|
|
|
|
then
|
|
|
|
rm -f "/tmp/olsrd.watchdog"
|
|
|
|
else
|
|
|
|
uptime=`cat /proc/uptime | cut -d' ' -f1`
|
|
|
|
date=`date`
|
|
|
|
echo "$uptime $date" >> /tmp/olsrd.log
|
|
|
|
/etc/init.d/olsrd restart
|
|
|
|
fi
|
2013-11-14 23:11:16 -07:00
|
|
|
|
2015-01-15 17:35:55 -07:00
|
|
|
# With interval of 5 seconds this gives ~3 chances
|
|
|
|
# for a file write before next loop.
|
|
|
|
sleep 15
|
|
|
|
|
|
|
|
done
|
2014-11-03 20:59:34 -07:00
|
|
|
|