DevOps / Scripts
bash
Intermediate
VPN Status Checker
Check if the WireGuard VPN tunnel is active and reconnect if it dropped.
bash
#!/bin/bash
IFACE=wg0
if ! ip link show $IFACE up > /dev/null 2>&1; then
echo "$(date) $IFACE down - reconnecting" >> /var/log/vpn-monitor.log
wg-quick up $IFACE
fi
Prerequisites
- WireGuard
- ip
Pro Tips
- → Schedule every minute with cron for auto-reconnect.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Intermediate
- Read time
- 2 min
- Published
- Aug 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Postgres S3 Backup
Dump a Postgres database, gzip it, push to S3 with AES256 encryption.
bash
·
Intermediate
Disk Usage Alert
Send an alert when any mounted filesystem exceeds a usage threshold.
bash
·
Beginner
Docker Image Cleanup Script
Remove dangling images, stopped containers and unused volumes in one pass.
bash
·
Intermediate