prevent config loss
This commit is contained in:
5
init.sh
5
init.sh
@@ -8,7 +8,10 @@ PHY_IF=${WG_HOST_INTERFACE:-$(ip route | awk '/default/ { print $5 }')}
|
||||
ADDRESS=${WG_ADDRESS:-10.200.200.1/24}
|
||||
|
||||
function shutdown() {
|
||||
wg showconf $WG_IF > /etc/wireguard/$WG_IF.conf
|
||||
CONF=$(wg showconf $WG_IF)
|
||||
if [ ! -z "$CONF" ]; then
|
||||
echo "$CONF" > /etc/wireguard/$WG_IF.conf
|
||||
fi
|
||||
ip link del dev $WG_IF
|
||||
setup_iptables "D"
|
||||
killall sleep
|
||||
|
Reference in New Issue
Block a user