Add an ENABLED line to /etc/default/dump1090-fa on upgrade if missing

This commit is contained in:
Oliver Jowett 2019-03-12 11:39:05 +00:00
parent 9136766b9c
commit 14c458db8c

View file

@ -49,6 +49,20 @@ case "$1" in
fi fi
fi fi
# on upgrade, add an ENABLED line if it's not already present
if dpkg --compare-versions "$2" lt-nl "3.7.0"
then
if [ -f /etc/default/dump1090-fa ]
then
if ! grep -q -E '^ENABLED=' /etc/default/dump1090-fa
then
echo "Setting ENABLED=yes in /etc/default/dump1090-fa.." >&2
echo "# Automatically added by upgrade from $2" >>/etc/default/dump1090-fa
echo "ENABLED=yes" >>/etc/default/dump1090-fa
fi
fi
fi
echo "Restarting lighttpd.." >&2 echo "Restarting lighttpd.." >&2
invoke-rc.d lighttpd restart || true invoke-rc.d lighttpd restart || true
;; ;;