op-packages/ShadowVPN/files/shadowvpn.hotplug
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

11 lines
267 B
Bash
Executable File

#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
device=$(ip route show 0/0 | sed -e 's/.* dev \([^ ]*\).*/\1/')
[ -z "$device" -o "$DEVICE" = "$device" ] || exit 0
/etc/init.d/shadowvpn restart
logger -t ShadowVPN "Restart ShadowVPN due to ifup of $INTERFACE ($DEVICE)"