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
enable() {
if [[ -e /etc/systemd/network/wg0.netdev ]]
if [[ -e /etc/systemd/network/jopixel.netdev ]]
then
echo 'Config already enabled'
elif [[ ! -e /etc/systemd/network/wg0.netdev.disabled ]]
elif [[ ! -e /etc/systemd/network/jopixel.netdev.disabled ]]
then
echo 'No disabled config found!'
else
mv -v /etc/systemd/network/wg0.netdev{.disabled,}
mv -v /etc/systemd/network/jopixel.netdev{.disabled,}
fi
systemctl restart systemd-networkd
}
disable() {
if [[ -e /etc/systemd/network/wg0.netdev ]]
if [[ -e /etc/systemd/network/jopixel.netdev ]]
then
mv -v /etc/systemd/network/wg0.netdev{,.disabled}
mv -v /etc/systemd/network/jopixel.netdev{,.disabled}
else
echo 'No config found!'
fi
networkctl delete wg0
networkctl delete jopixel
systemctl restart systemd-networkd
}