Tidying
This commit is contained in:
parent
77795c542f
commit
cc875c00fe
|
@ -123,24 +123,20 @@ function mesh_avahi {
|
||||||
function keep_avahi_running {
|
function keep_avahi_running {
|
||||||
WATCHDOG_SCRIPT_NAME="keepon"
|
WATCHDOG_SCRIPT_NAME="keepon"
|
||||||
|
|
||||||
if [ ! -f "/usr/bin/$WATCHDOG_SCRIPT_NAME" ]; then
|
if grep -q "avahi daemon" "/usr/bin/$WATCHDOG_SCRIPT_NAME"; then
|
||||||
{ echo '#!/bin/bash';
|
return
|
||||||
echo 'LOGFILE=/var/log/keepon.log';
|
|
||||||
echo "CURRENT_DATE=\$(date)"; } > "/usr/bin/$WATCHDOG_SCRIPT_NAME"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "avahi daemon" "/usr/bin/$WATCHDOG_SCRIPT_NAME"; then
|
{ echo '';
|
||||||
{ echo '';
|
echo '# keep avahi daemon running';
|
||||||
echo '# keep avahi daemon running';
|
echo "AVAHI_RUNNING=\$(systemctl is-active avahi-daemon >/dev/null 2>&1 && echo Running)";
|
||||||
echo "AVAHI_RUNNING=\$(systemctl is-active avahi-daemon >/dev/null 2>&1 && echo Running)";
|
echo "if [ ! \$AVAHI_RUNNING ]; then";
|
||||||
echo "if [ ! \$AVAHI_RUNNING ]; then";
|
echo ' systemctl start avahi-daemon';
|
||||||
echo ' systemctl start avahi-daemon';
|
echo " echo -n \$CURRENT_DATE >> \$LOGFILE";
|
||||||
echo " echo -n \$CURRENT_DATE >> \$LOGFILE";
|
echo " echo \" Avahi daemon restarted\" >> \$LOGFILE";
|
||||||
echo " echo \" Avahi daemon restarted\" >> \$LOGFILE";
|
echo 'fi';
|
||||||
echo 'fi';
|
echo '# End of avahi'; } >> "/usr/bin/$WATCHDOG_SCRIPT_NAME"
|
||||||
echo '# End of avahi'; } >> "/usr/bin/$WATCHDOG_SCRIPT_NAME"
|
chmod +x "/usr/bin/$WATCHDOG_SCRIPT_NAME"
|
||||||
chmod +x "/usr/bin/$WATCHDOG_SCRIPT_NAME"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_avahi {
|
function install_avahi {
|
||||||
|
|
Loading…
Reference in New Issue