#!/bin/bash VERSION="1.1.0" cmd="$1" group="$2" add_service_to_group() { service="$1" group="$2" if [[ ! -f "/etc/systemd/system/${group}.target" ]]; then sudo tee "/etc/systemd/system/${group}.target" > /dev/null < [group] COMMANDS: stop Stop all services linked to killswitch.target, or a specific group start Start all services linked to killswitch.target, or a specific group status Show the current status of killswitch.target or a group add [service] to [group] Add a service to a group (creates group-target if needed) -h, --help Show this help message -v, --version Show version information ABOUT KILLSWITCH: What it does: Stops or starts services linked to 'killswitch.target'. Supports groups for partial control. How to link services: 1) Edit your systemd service and add: PartOf=.target 2) Enable the service for boot: sudo systemctl enable .service 3) Use killsw script to manage: killsw start [group] killsw stop [group] EOF ;; -v|--version) echo "KillSwitch CLI Tool version $VERSION" ;; *) echo "Ahoy, matey! No command provided. Check --help for guidance." ;; esac