You are not logged in.

#1 2007-07-08 12:42:42

vxp
Member
Registered: 2007-06-03
Posts: 12

Wireless network (and a shell script for you guys, also)

I don't know the right way to bring up my wireless iface at bootup, so I wrote a small shell script to do it for me.
Feel free to use it if you find it useful..

I'd also appreciate someone telling me what *IS* the arch way of doing what my shell script's doing smile

#!/usr/bin/env bash
#
# Val Polyakov <vxp@yoda.im>
# 7/8/07
#

#
# Change these to reflect your network
#
PATH=/usr/sbin:/sbin:/bin
IFACE=ifaceNameOfYourWirelessCard
DRIVER=moduleNameForYourWirelessCard
SID=yourSID
ENCKEY=yourEncryptionKey

#
# Don't change anything beyond this point.
#

case "$1" in
    start)
        echo "Loading the wireless card driver"
        modprobe $DRIVER
    echo "Setting up the SID and encryption key"
        iwconfig $IFACE essid $SID enc $ENCKEY
    echo "Bringing up the wireless interface"
    ifconfig $IFACE up
    if [ -f /var/run/dhcpcd-$IFACE.pid ]
    then
        rm /var/run/dhcpcd-$IFACE.pid
    fi
    echo "Running the dhcp client"
    dhcpcd $IFACE
        ;;
    stop)
        echo "Bringing down the wireless interface"
    ifconfig $IFACE down
    echo "Unloading the driver"
    rmmod $DRIVER   
    ;;
    restart)
        $0 stop
    sleep 2
        $0 start
        ;;
    *)
        echo "usage: $0 {start|stop|restart}"
    ;;
esac
exit 0

Offline

#2 2007-07-08 13:12:34

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Wireless network (and a shell script for you guys, also)

http://wiki.archlinux.org/index.php/Wireless

Network profiles are not working for me, though.


Hail to the thief!

Offline

#3 2007-07-08 13:14:58

vxp
Member
Registered: 2007-06-03
Posts: 12

Re: Wireless network (and a shell script for you guys, also)

harlekin wrote:

http://wiki.archlinux.org/index.php/Wireless

Network profiles are not working for me, though.

it didnt work for me either

i did set it up as directed in that wiki, by my essid kept getting set to "d" instead of "devnull" as I specified in the profile
so obviously that didnt work.

hence, wrote the shell script and stuck it in /etc/rc.d smile

Offline

#4 2007-07-08 16:23:38

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Wireless network (and a shell script for you guys, also)

If your wireless drivers support wpa_supplicant, you could try autowifi from http://www.archlinux.org/~thomas/autowifi-svn/ It handles multiple wireless networks very well. There is no documentation right now, just read here: http://archlinux.org/pipermail/arch-dev … 00867.html

Offline

#5 2007-07-08 16:39:47

vxp
Member
Registered: 2007-06-03
Posts: 12

Re: Wireless network (and a shell script for you guys, also)

brain0 wrote:

If your wireless drivers support wpa_supplicant, you could try autowifi from http://www.archlinux.org/~thomas/autowifi-svn/ It handles multiple wireless networks very well. There is no documentation right now, just read here: http://archlinux.org/pipermail/arch-dev … 00867.html

what would the benefit of that be, as compared to my script ?
the shell script i made (and pasted) works just fine, sits in /etc/rc.d and is called by /etc/rc.conf

i was just curious whats the official, i guess, way to do it with arch

since network profiles dont work for some reason, i figured i must be missing something.. smile

Offline

Board footer

Powered by FluxBB