Skip to content

Instantly share code, notes, and snippets.

@vimagick
Created January 10, 2025 03:46
Show Gist options
  • Save vimagick/9437f3e35376bbf5c890adc1a504dbd4 to your computer and use it in GitHub Desktop.
Save vimagick/9437f3e35376bbf5c890adc1a504dbd4 to your computer and use it in GitHub Desktop.
#!/bin/sh
WG_HOSTS="192.168.X.1 192.168.Y.1 192.168.Z.1"
WG_IFACE=wg
for host in $WG_HOSTS; do
ping -q -W 1 -i 2 -c 3 $host || { ifup $WG_IFACE; break; }
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment