This commit is contained in:
Bob Mottram 2018-05-27 11:39:59 +01:00
parent 77795c542f
commit cc875c00fe
1 changed files with 12 additions and 16 deletions

View File

@ -123,13 +123,10 @@ function mesh_avahi {
function keep_avahi_running {
WATCHDOG_SCRIPT_NAME="keepon"
if [ ! -f "/usr/bin/$WATCHDOG_SCRIPT_NAME" ]; then
{ echo '#!/bin/bash';
echo 'LOGFILE=/var/log/keepon.log';
echo "CURRENT_DATE=\$(date)"; } > "/usr/bin/$WATCHDOG_SCRIPT_NAME"
if grep -q "avahi daemon" "/usr/bin/$WATCHDOG_SCRIPT_NAME"; then
return
fi
if ! grep -q "avahi daemon" "/usr/bin/$WATCHDOG_SCRIPT_NAME"; then
{ echo '';
echo '# keep avahi daemon running';
echo "AVAHI_RUNNING=\$(systemctl is-active avahi-daemon >/dev/null 2>&1 && echo Running)";
@ -140,7 +137,6 @@ function keep_avahi_running {
echo 'fi';
echo '# End of avahi'; } >> "/usr/bin/$WATCHDOG_SCRIPT_NAME"
chmod +x "/usr/bin/$WATCHDOG_SCRIPT_NAME"
fi
}
function install_avahi {