add missing copyright
[openwrt.git] / package / base-files / default / sbin / hotplug
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 # bypass the normal hotplug path for firmware loading
5 # would otherwise cause problems with drivers like bcm43xx
6 [ "$1" = "firmware" -a "$ACTION" = "add" ] && {
7 [ -f "/lib/firmware/$FIRMWARE" ] && {
8 echo 1 > "/sys$DEVPATH/loading"
9 cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data"
10 echo 0 > "/sys$DEVPATH/loading"
11 }
12 exit 0
13 }
14
15 . /etc/functions.sh
16 . /etc/config/network
17
18 PATH=/bin:/sbin:/usr/bin:/usr/sbin
19 LOGNAME=root
20 USER=root
21 export PATH LOGNAME USER
22
23 [ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && {
24 for script in $(ls /etc/hotplug.d/$1/* 2>&-); do (
25 [ -f $script ] && . $script
26 ); done
27 }
This page took 0.046377 seconds and 5 git commands to generate.