Update src/killsw

This commit is contained in:
2026-03-24 19:52:18 +01:00
parent 31a999c019
commit f9bb3c21a9

View File

@@ -3,22 +3,35 @@
VERSION="1.0.1"
cmd="$1"
group="$2"
case "$cmd" in
stop)
systemctl stop killswitch.target
echo "Killswitch activated: all linked services have been stopped."
if [[ -n "$group" ]]; then
# Alleen die groep stoppen
systemctl stop "$group".target
echo "Killswitch activated: stopped group '$group'."
else
# Geen groep, alles stoppen
systemctl stop killswitch.target
echo "Killswitch activated: all linked services have been stopped."
fi
;;
start)
systemctl start killswitch.target
echo "Killswitch deactivated: all linked services have been started."
if [[ -n "$group" ]]; then
systemctl start "$group".target
echo "Killswitch deactivated: started group '$group'."
else
systemctl start killswitch.target
echo "Killswitch deactivated: all linked services have been started."
fi
;;
status)
systemctl status killswitch.target
;;
add)
if [[ -n "$2" && "$3" == "to" && -n "$4" ]]; then
echo "Called add $2 to $4"
echo "Adding service '$2' to group '$4'..."
else
echo "Usage: killsw add [service] to [group]"
fi