iwi.sh script modified for DHCP auto load in
FreeBSD-5.4-RELENG-p2
Marcin Jessa
lists at yazzy.org
Thu Jun 23 20:24:42 GMT 2005
On Thu, 23 Jun 2005 20:25:13 +0100
Hanno Krusken <lr101fc at yahoo.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi folks,
>
> I'm a lazy guy, and don't want to call iwicontrol all the time...
Apparently too lazy to read docs or google.
You're waisting your time.
All you need to do is to create /etc/start_if.iwi0 with your iwicontrol commands and define IP, ssid, etc of iwi0 in /etc/rc.conf
> So I installed the "iwi-firmware-2.3_1" from the ports collection
> /usr/ports/net/iwi-firmware" in FreeBSD-5.4-RELENG-p2, for a INTEL
> pro-2915abg miniPCI card.
>
> the trick is, to load the:
> miibus_load="YES" and the
> if_iwi_load="YES" command
> in "/boot/loader.conf" under NETWORK DEVICES !
> this way the:
> "if_iwi.ko" is loaded right from the begining !
Heh, you make it sound like it was a secretly hidden door to the holy grail.
> the "/etc/rc.conf" need the entries:
> iwi_enable="YES
> iwi_interfaces="iwi0"
This does not make sense since your script has : ${iwi_interfaces="iwi0"}
> iwi_mod_iwi0="bss"
>
> after that my modified:
> /usr/local/etc/rc.d/iwi.sh dose the rest ;o)
>
> after every boot, the intel pro 2915abg get associated automaticly to
> any open wireless network !
Good, what if you want to stick to only one ssid?
> This settings works on my home router and at work with a total differend
> "ssid" at full speed !
>
> To make it even more conviniens, install the "xwlans" package for X11,
> and load it with:
> xtoolwait xwlans -i iwi0 -ct -black -n 2 -m 1 -nf
> in your ".xsession" file, you get a nice bar in the top left corner,
> that informes you constantly about the signal strengt.
>
> PS: it works with "BlackBox" window manager on my laptop, I don't know
> if this will work with desktop manager like KDE or GNOME ??!!
>
> THE SCRIPT: (in /usr/local/etc/rc.d/iwi.sh)
> there are only a few lines modified, to allow the firmware to load !
> - ------------------------------------------
> #!/bin/sh
> #
> # $FreeBSD: ports/net/iwi-firmware/files/iwi.sh.in,v 1.1 2005/06/22
> 19:43:26 flz Exp $
> #
>
> # PROVIDE: iwi
> # REQUIRE: LOGIN abi
> # BEFORE: securelevel
> # KEYWORD: FreeBSD shutdown
>
> # Add the following line to /etc/rc.conf to enable `iwi':
> #
> # iwi_enable="YES"
> #
>
> . "/etc/rc.subr"
>
> name="iwi"
> rcvar=`set_rcvar`
>
> start_cmd="iwi_start_cmd"
> stop_cmd="iwi_stop_cmd"
>
> load_rc_config "$name"
> : ${iwi_enable="NO"}
> : ${iwi_interfaces="iwi0"}
>
> command="/usr/local/sbin/iwicontrol"
>
> iwi_start_cmd()
> {
> echo -n "Starting iwi"
> for i in ${iwi_interfaces}; do
> eval _mode=\$iwi_mode_${i}
> case ${_mode} in
> ""|bss|ibss|sniffer)
> ;;
> *)
> echo "${_mode} - Possible values for iwi_mode_${i} are bss|ibss|sniffer."
> exit 1
> ;;
> esac
>
> eval _mode=\$_iwi_file_${i}
> echo -n " [${i}:${_mode:=bss}]"
> ${command} -i ${i} -d /usr/local/share/iwi-firmware -m ${_mode:=bss}
> done
> echo -n " [${i}:${switch}] "
> for i in ${iwi_interfaces}; do
> ${command} -i ${i} -r
> done
> echo -n " [${i}:${mode:=11g}] "
> ifconfig iwi0 mode 11g
> echo -n " [${i}:${DHCP:=client}] "
> dhclient -nw iwi0
> echo "."
> }
>
> iwi_stop_cmd()
> {
> echo "Stopping iwi."
> for i in ${iwi_interfaces}; do
> ${command} -i ${i} -k
> done
> }
>
> run_rc_command "$1"
> - -------------------------------------------
More information about the freebsd-mobile
mailing list