1 |
On Friday 30 March 2007 1:11 am, Neil Bothwick wrote: |
2 |
> On Thu, 29 Mar 2007 22:20:21 -0700, Daevid Vincent wrote: |
3 |
> |
4 |
> > Please tell me there is some way to tweak my /etc/conf.d/wireless (or |
5 |
> > anything for that matter), so that I can tell it, "hey, when connecting |
6 |
> > to 'MATRIX', always use 802.11b and/or a certain channel range |
7 |
> > (presumably in the 'b' range)". |
8 |
> |
9 |
> You can do this globally for the interface, with channel_ath0. You could |
10 |
> probably use the preassociate() function to do it on a per-essid basis. |
11 |
> See wireless.example. |
12 |
> |
13 |
> > Furthermore, it would REALLY be great if I could do something whereby, |
14 |
> > if I have net.eth0 (i.e. CAT5 cable) then don't start net.ath0, else |
15 |
> > try net.ath0. Right now I have net.ath0 disabled by default because I |
16 |
> > hate when it starts up when I'm plugged in at work, as my traffic seems |
17 |
> > to go over the "slower" ath0 rather than the faster eth0 port. ?! I |
18 |
> > have ifplugd installed, but I don't think it can manage this kind of |
19 |
> > (seemingly obvious and intelligent) decision. |
20 |
> |
21 |
> ifplugd's task is to signal when eth0's cable is connected or |
22 |
> disconnected, not make decisions about other interfaces for you. |
23 |
> |
24 |
> Use the pre-up function in /etc/conf.d/net. |
25 |
> |
26 |
> preup() { |
27 |
> if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status |
28 |
> then |
29 |
> return 1 |
30 |
> fi |
31 |
> } |
32 |
> |
33 |
> This will prevent ath0 starting if eth0 is connected. |
34 |
|
35 |
Thanks Neil for the help, unfortunately it didn't seem to work for me... |
36 |
|
37 |
locutus conf.d # /etc/init.d/net.ath0 start |
38 |
* Starting ath0 |
39 |
* Running preup function |
40 |
/etc/conf.d/net: line 10: if: command not found |
41 |
/etc/conf.d/net: line 11: then: command not found |
42 |
/etc/conf.d/net: line 12: return: command not found |
43 |
/etc/conf.d/net: line 13: fi: command not found |
44 |
* preup ath0 failed |
45 |
|
46 |
[ !! ] |
47 |
locutus conf.d # cat /etc/conf.d/net |
48 |
# This blank configuration will automatically use DHCP for any net.* |
49 |
# scripts in /etc/init.d. To create a more complete configuration, |
50 |
# please review /etc/conf.d/net.example and save your configuration |
51 |
# in /etc/conf.d/net (this file :]!). |
52 |
dhcpcd_eth0="-t 10" |
53 |
dhcpcd_ath0="-t 30" |
54 |
dhcpcd_wlan0="-t 20" |
55 |
|
56 |
preup() { |
57 |
if [ ${IFACE} == "ath0" ] && /etc/init.d/net.eth0 --quiet status |
58 |
then |
59 |
return 1 |
60 |
fi |
61 |
} |
62 |
|
63 |
-- |
64 |
gentoo-user@g.o mailing list |