blob: 360b75a3fcc2ff617a6af9a97f9ade52d03478e5 [file] [log] [blame]
Denys Vlasenko6cf7f012009-11-06 04:04:19 +01001#!/bin/sh
2
3exec 2>&1
4exec </dev/null
5
6pwd="$PWD"
7
8if="${PWD##*/ifplugd_}"
9
Denys Vlasenkobf40f562009-11-07 17:54:44 +010010echo "* Starting ifplugd on $if [$$]"
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010011exec \
12env - PATH="$PATH" \
13softlimit \
14setuidgid root \
Denys Vlasenkobf40f562009-11-07 17:54:44 +010015ifplugd -apqns -t3 -u9 -d9 -i "$if" -r "$pwd/ifplugd_handler"
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010016
Denys Vlasenkobf40f562009-11-07 17:54:44 +010017# we use -t3 to wake ifplugd up less often
18
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010019#-a Do not up interface automatically
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010020#-p Dont run script on daemon startup
21#-q Dont run script on daemon quit
Denys Vlasenkobf40f562009-11-07 17:54:44 +010022#-n Do not daemonize
23#-s Do not log to syslog
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010024#-t SECS Poll time in seconds
25#-u SECS Delay before running script after link up
26#-d SECS Delay after link down
Denys Vlasenkobf40f562009-11-07 17:54:44 +010027#-i IFACE Interface
28#-r PROG Script to run
29#-f/-F Treat link detection error as link down/link up (otherwise exit on error)
30#-M Monitor creation/destruction of interface (otherwise it must exist)
31#-x ARG Extra argument for script
32#-I Dont exit on nonzero exit code from script
33#-l Run script on startup even if no cable is detected
Denys Vlasenko6cf7f012009-11-06 04:04:19 +010034#-m MODE API mode (mii, priv, ethtool, wlan, auto)