From f1b76070d60b11b8a26d756ce0d86946d7147ea3 Mon Sep 17 00:00:00 2001 From: Olivier Mevel Date: Thu, 25 Jun 2020 21:24:28 +0200 Subject: [PATCH] Added reboot in fix #139 and #141 --- install.sh | 106 +++++++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/install.sh b/install.sh index a87da475..07ee3c8e 100755 --- a/install.sh +++ b/install.sh @@ -313,58 +313,68 @@ sudo chown root /lib/systemd/system-shutdown/nabboot.py sudo chmod +x /lib/systemd/system-shutdown/nabboot.py # Fix Pynab logs not rotated #139 -cat > '/tmp/pynab' <<- END -/var/log/nab*.log - { - daily - rotate 7 - missingok - notifempty - copytruncate - delaycompress - compress - } -END -sudo mv /tmp/pynab /etc/logrotate.d/pynab +if [ ! -f "/etc/logrotate.d/pynab" ]; then + cat > '/tmp/pynab' <<- END + /var/log/nab*.log + { + daily + rotate 7 + missingok + notifempty + copytruncate + delaycompress + compress + } + END + sudo mv /tmp/pynab /etc/logrotate.d/pynab + sudo touch /tmp/pynab.upgrade.reboot +fi # Fix Advertise rabbit on local network #141 -cat > '/tmp/pynab.service' <<- END - - - - - - Nabaztag rabbit (%h) - - _http._tcp - 80 - vendor=violet - model=tag:tag:tag - - -END -sudo mv /tmp/pynab.service /etc/avahi/services/pynab.service - - - -cat > '/tmp/nabblocky.service' <<- END - - - - - - NabBlockly (%h) - - _http._tcp - 8080 - vendor=Paul Guyot - model=tag:tag:tag - - -END -sudo mv /tmp/nabblocky.service /etc/avahi/services/nabblocky.service +if [ ! -f "/etc/avahi/services/pynab.service" ]; then + + cat > '/tmp/pynab.service' <<- END + + + + + + Nabaztag rabbit (%h) + + _http._tcp + 80 + vendor=violet + model=tag:tag:tag + + + END + sudo mv /tmp/pynab.service /etc/avahi/services/pynab.service + sudo touch /tmp/pynab.upgrade.reboot + +fi +if [ ! -f "/etc/avahi/services/nabblocky.service" ]; then + + cat > '/tmp/nabblocky.service' <<- END + + + + + + NabBlockly (%h) + + _http._tcp + 8080 + vendor=Paul Guyot + model=tag:tag:tag + + + END + sudo mv /tmp/nabblocky.service /etc/avahi/services/nabblocky.service + sudo touch /tmp/pynab.upgrade.reboot + +fi if [ -e /tmp/pynab.upgrade.reboot ]; then echo "Upgrade requires reboot, rebooting now - 14/14" > /tmp/pynab.upgrade