diff --git a/init.sh b/init.sh index 926dc69..2210e79 100755 --- a/init.sh +++ b/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