mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 18:45:13 +08:00
update 2026-05-10 09:48:30
This commit is contained in:
1 parent
95ac96413e
commit
0b362674f1
6244 files changed
+2992248
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "ifup" ] || exit 0
|
||||
|
||||
DEVICE=$(logread | grep "link is up" | tail -n 1 | awk -F "'" '{print $2}')
|
||||
DEVICE_TYPE=$(ip link show dev "$DEVICE")
|
||||
|
||||
case "$DEVICE_TYPE" in
|
||||
*"link/ether"*)
|
||||
(
|
||||
LOCK_FILE="/tmp/lock/daed_hotplug_lock"
|
||||
if [ -f "$LOCK_FILE" ]; then
|
||||
exit 1
|
||||
else
|
||||
echo $$ > "$LOCK_FILE" 2>/dev/null
|
||||
trap 'rm -f "$LOCK_FILE"' EXIT
|
||||
sleep 60
|
||||
/etc/init.d/daed restart 2>&1
|
||||
fi
|
||||
) &
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user