2023-09-24 15:15:54 +02:00
|
|
|
#!/usr/bin/with-contenv bash
|
2024-12-27 13:00:23 +00:00
|
|
|
|
2023-09-24 15:15:54 +02:00
|
|
|
# Bring up WireGuard if not already up
|
|
|
|
|
if ! ip link show dev wg0 > /dev/null 2>&1; then
|
|
|
|
|
wg-quick up wg0
|
|
|
|
|
fi
|
|
|
|
|
|
2024-12-27 13:00:23 +00:00
|
|
|
# Monitor wireguard status
|
|
|
|
|
while true; do
|
|
|
|
|
if ! ip link show dev wg0 | grep -q "UP"; then
|
|
|
|
|
wg-quick up wg0
|
|
|
|
|
fi
|
|
|
|
|
sleep 60
|
|
|
|
|
done
|