diff options
| author | Dirk von Suchodoletz | 2009-01-13 20:31:08 +0100 |
|---|---|---|
| committer | Dirk von Suchodoletz | 2009-01-13 20:31:08 +0100 |
| commit | aa6626925eff26751e156bf392256298dad07a34 (patch) | |
| tree | 099f88ce68a4e3bef1cab26385d2d51e6c6c6709 /os-plugins/plugins/wlanboot/init-hooks | |
| parent | * test commit (diff) | |
| download | core-aa6626925eff26751e156bf392256298dad07a34.tar.gz core-aa6626925eff26751e156bf392256298dad07a34.tar.xz core-aa6626925eff26751e156bf392256298dad07a34.zip | |
Adding a new plugin "wlanboot". Just first checkin - untested ...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2474 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/wlanboot/init-hooks')
| -rwxr-xr-x | os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh b/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh new file mode 100755 index 00000000..169e567d --- /dev/null +++ b/os-plugins/plugins/wlanboot/init-hooks/10-nw-if-config/wlanboot.sh @@ -0,0 +1,36 @@ +# Copyright (c) 2009 - OpenSLX GmbH +# +# This program/file is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org +# +# stage3 init-hook 10 of 'wlanboot' plugin - firing up the wlan connection + +if [ $wlanboot_active -ne 0 ]; then + # get essid for WLAN boot + for source in /proc/cmdline /etc/initramfs-setup ; do + essid=$(grep essid $source) + if [ -n "$essid" ] ; then + essid=${essid#essid=} + break + fi + done + # do WLAN specific settings, definition of wlan interface name and wireless + # connect + wlanif=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//") + if [ -n "$if" ] ; then + ip link set dev ${wlanif} up + if iwconfig ${wlanif} mode managed essid "${essid}"; then + nwif=${wlanif} + else + error " Unable to configure the WLAN interface." + fi + else + error " No wireless LAN capable interface found. Did you provide the \ +proper kernel\n modules and firmware?" +fi + |
