Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- if [ "$1" = "" -o "$2" = "" ]
- then
- echo "usage: $0 notify oem_name"
- exit 1
- fi
- NOTIFY=`echo $1`
- OEM=$2
- LOGGER="logger"
- case ${NOTIFY} in
- # WLAN an / aus
- 0x05)
- if [ -e /var/run/wpa_supplicant/wlan0 ]
- then
- /usr/sbin/wpa_cli terminate
- /bin/sleep 2
- /sbin/ifconfig wlan0 destroy
- MESSAGE="WLAN deactivated"
- else
- /sbin/ifconfig wlan0 create wlandev wpi0
- /bin/sleep 2
- /usr/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
- MESSAGE="WLAN activated"
- fi
- ;;
- # Standby
- 0x04)
- MESSAGE="Standby"
- /bin/sync
- /bin/sync
- /bin/sync
- /usr/sbin/zzz
- ;;
- # CD Eject
- 0x09)
- MESSAGE="Ejecting CD"
- /sbin/camcontrol eject cd0
- ;;
- # Sync Disks
- 0x0c)
- MESSAGE="Syncing disks"
- /bin/sync
- esac
- ${LOGGER} ${MESSAGE}
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement