Added stop action for LSB compliance

This commit is contained in:
billz 2020-03-20 09:05:33 +00:00
parent de2ded1984
commit aac5025029
1 changed files with 12 additions and 2 deletions

View File

@ -22,8 +22,13 @@ case $key in
;;
-s|--seconds)
seconds="$2"
shift # past argument
shift # past value
shift
shift
;;
-a|--action)
action="$2"
shift
shift
;;
esac
done
@ -36,6 +41,11 @@ systemctl stop hostapd.service
systemctl stop dnsmasq.service
systemctl stop dhcpcd.service
if [ "${action}" = "stop" ]; then
echo "Services stopped. Exiting."
exit 0
fi
if [ -f "$DAEMONPATH" ]; then
echo "Changing RaspAP Daemon --interface to $interface"
sed -i "s/\(--interface \)[[:alnum:]]*/\1$interface/" "$DAEMONPATH"