Update src/killsw
This commit is contained in:
@@ -9,7 +9,6 @@ add_service_to_group() {
|
|||||||
service="$1"
|
service="$1"
|
||||||
group="$2"
|
group="$2"
|
||||||
|
|
||||||
# Maak de groep-target aan als die nog niet bestaat
|
|
||||||
if [[ ! -f "/etc/systemd/system/${group}.target" ]]; then
|
if [[ ! -f "/etc/systemd/system/${group}.target" ]]; then
|
||||||
sudo tee "/etc/systemd/system/${group}.target" > /dev/null <<EOF
|
sudo tee "/etc/systemd/system/${group}.target" > /dev/null <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -18,10 +17,8 @@ PartOf=killswitch.target
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Zorg dat de .wants map bestaat
|
|
||||||
sudo mkdir -p "/etc/systemd/system/${group}.target.wants"
|
sudo mkdir -p "/etc/systemd/system/${group}.target.wants"
|
||||||
|
|
||||||
# Voeg de service toe aan de groep
|
|
||||||
sudo ln -sf "/etc/systemd/system/${service}.service" "/etc/systemd/system/${group}.target.wants/${service}.service"
|
sudo ln -sf "/etc/systemd/system/${service}.service" "/etc/systemd/system/${group}.target.wants/${service}.service"
|
||||||
|
|
||||||
echo "Added service '$service' to group '$group'."
|
echo "Added service '$service' to group '$group'."
|
||||||
|
|||||||
Reference in New Issue
Block a user