3 # log the event to a file
9 # provide env-like output when the real thing is not available
10 if [ ! -x /usr/bin/env ]; then
12 # bash prepends "declare -x " at the beginning of each line
13 export -p | sed -e 's/^\(declare -x\|export\) //'
17 # writes a copy of the current hotplug event to stdout
21 echo "HOTPLUG_TIME='$(date)'"
24 } | egrep -v "^'$|^(_|PATH|PWD|PPID|SHLVL|HOME|IFS|OPTIND|PS[1234])="
27 [ "$EVENTS_LOG" ] || EVENTS_LOG='/dev/hotplug.log'
29 log_to_stdout >> $EVENTS_LOG