Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | exec 2>&1 |
| 4 | exec </dev/null |
| 5 | |
| 6 | pwd="$PWD" |
| 7 | |
| 8 | if="${PWD##*/ifplugd_}" |
| 9 | |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame^] | 10 | echo "* Starting ifplugd on $if [$$]" |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 11 | exec \ |
| 12 | env - PATH="$PATH" \ |
| 13 | softlimit \ |
| 14 | setuidgid root \ |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame^] | 15 | ifplugd -apqns -t3 -u9 -d9 -i "$if" -r "$pwd/ifplugd_handler" |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 16 | |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame^] | 17 | # we use -t3 to wake ifplugd up less often |
| 18 | |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 19 | #-a Do not up interface automatically |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 20 | #-p Dont run script on daemon startup |
| 21 | #-q Dont run script on daemon quit |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame^] | 22 | #-n Do not daemonize |
| 23 | #-s Do not log to syslog |
Denys Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 24 | #-t SECS Poll time in seconds |
| 25 | #-u SECS Delay before running script after link up |
| 26 | #-d SECS Delay after link down |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame^] | 27 | #-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 Vlasenko | 6cf7f01 | 2009-11-06 04:04:19 +0100 | [diff] [blame] | 34 | #-m MODE API mode (mii, priv, ethtool, wlan, auto) |