1
0
Fork 0

bin(jwg): update

This commit is contained in:
Vladimír Dudr 2024-03-08 22:38:07 +01:00
parent 9d2fcad29f
commit 3ebba8dcd5

View file

@ -1,28 +1,28 @@
#!/bin/bash #!/bin/bash
enable() { enable() {
if [[ -e /etc/systemd/network/wg0.netdev ]] if [[ -e /etc/systemd/network/jopixel.netdev ]]
then then
echo 'Config already enabled' echo 'Config already enabled'
elif [[ ! -e /etc/systemd/network/wg0.netdev.disabled ]] elif [[ ! -e /etc/systemd/network/jopixel.netdev.disabled ]]
then then
echo 'No disabled config found!' echo 'No disabled config found!'
else else
mv -v /etc/systemd/network/wg0.netdev{.disabled,} mv -v /etc/systemd/network/jopixel.netdev{.disabled,}
fi fi
systemctl restart systemd-networkd systemctl restart systemd-networkd
} }
disable() { disable() {
if [[ -e /etc/systemd/network/wg0.netdev ]] if [[ -e /etc/systemd/network/jopixel.netdev ]]
then then
mv -v /etc/systemd/network/wg0.netdev{,.disabled} mv -v /etc/systemd/network/jopixel.netdev{,.disabled}
else else
echo 'No config found!' echo 'No config found!'
fi fi
networkctl delete wg0 networkctl delete jopixel
systemctl restart systemd-networkd systemctl restart systemd-networkd
} }