diff --git a/network/wg-randomize.sh b/network/wg-randomize.sh new file mode 100755 index 0000000..f54e549 --- /dev/null +++ b/network/wg-randomize.sh @@ -0,0 +1,2 @@ +#!/bin/bash +ln -sf "$(find /etc/wireguard -maxdepth 1 -name '*.conf' ! -name 'wg0.conf' | shuf -n1)" /etc/wireguard/wg0.conf diff --git a/services/wg-randomize.service b/services/wg-randomize.service new file mode 100644 index 0000000..33aaf07 --- /dev/null +++ b/services/wg-randomize.service @@ -0,0 +1,11 @@ +[Unit] +Description=Randomize WireGuard config on shutdown + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/true +ExecStop=/home/lucas/scripts/network/wg-randomize.sh + +[Install] +WantedBy=multi-user.target