13 lines
522 B
Bash
Executable File
13 lines
522 B
Bash
Executable File
#!/bin/sh
|
|
PIDFILE=/var/run/tunneldigger.mesh-vpn.pid
|
|
|
|
if [ "$(uci get tunneldigger.@broker[0].enabled)" == "1" ]; then
|
|
if [ "$(pgrep tunneldigger)" != "$(cat $PIDFILE)" ]; then
|
|
/etc/init.d/tunneldigger restart
|
|
logger -t tunneldiger-watchdog "Daemon not running, restarted tunneldigger."
|
|
elif [ "$(batctl o |grep mesh-vpn |wc -l)" == "0" ]; then
|
|
/etc/init.d/tunneldigger restart
|
|
logger -t tunneldiger-watchdog "No neighbours on mesh-vpn interface, restarted tunneldigger."
|
|
fi
|
|
fi
|