mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-08-01 12:29:36 +08:00
23 lines
424 B
Bash
23 lines
424 B
Bash
#!/bin/sh
|
|
|
|
[ "$ACTION" = "ifup" ] || exit 0
|
|
[ "$INTERFACE" = "wan" ] || exit 0
|
|
|
|
WAN_PROTO="$(uci -q get network.wan.proto 2>/dev/null)"
|
|
[ "$WAN_PROTO" = "pppoe" ] || exit 0
|
|
|
|
LOCK_FILE="/var/run/ssrplus-pppoe-hotplug.lock"
|
|
|
|
(
|
|
if ! mkdir "$LOCK_FILE" 2>/dev/null; then
|
|
exit 0
|
|
fi
|
|
|
|
trap 'rmdir "$LOCK_FILE" 2>/dev/null' EXIT INT TERM
|
|
|
|
sleep 10
|
|
/etc/init.d/shadowsocksr restart >/dev/null 2>&1
|
|
) >/dev/null 2>&1 &
|
|
|
|
exit 0
|