You are not logged in.

#1 2008-03-31 08:25:17

nahoj
Member
Registered: 2004-11-05
Posts: 30

Autowifi - how should I make it run the scripts??? SOLVED

I have set up autowifi and it works very good!

One problem though: I would like to change the default printer depending on where I am. so I made this setup for autowifi:


  # This is the profile
  # running without wep
  NETWORK="dhcp"
  autowifi_connect() {
    lpotions -d MFC7820N
    cp /etc/resolv.conf.hasthagen /etc/resolv.conf
    brscan-skey
  }
  autowifi_disconnect() {
    brscan-skey -t :
  }


the problem is that it doesn't seem torun these scripts.
what am I doing wrong???

Last edited by nahoj (2008-03-31 16:22:05)


Computers never saves time - but they help you produce more in the same timespan...

Offline

#2 2008-03-31 11:13:41

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

Re: Autowifi - how should I make it run the scripts??? SOLVED

First of all, make sure you have the latest autowifi version. Then, when you connect to a network, monitor your syslog (/var/log/messages.log):

Mar 31 11:01:56 artin autowifi[2483]: Starting autowifi session for interface 'wlan0'
Mar 31 11:02:24 artin autowifi[2483]: Interface 'wlan0' connected to network 'eduroam'
Mar 31 11:02:24 artin autowifi-event[2679]: Using profile 'default'

The last line indicates that the profile 'default' is being used, so the script /etc/autowifi/networks/default will be used. To use a different script, you have to name it exactly like the SSID you connect to. Another possibility is to match the profile in /etc/autowifi/regexp, which might be overkill for your needs.

Can you paste the relevant parts of your syslog?

Offline

#3 2008-03-31 11:50:18

nahoj
Member
Registered: 2004-11-05
Posts: 30

Re: Autowifi - how should I make it run the scripts??? SOLVED

This part works all right!

  Mar 31 07:45:50   autowifi-event[7861]: Interface 'eth1' connected to network 'xxx'

The problem is the commands that are supposed to berun when connected:

'lpoptions -d oki'

or in the profile i copied above:
'lpotions -d mfc7820n'

How can I make those work? Do I have to make something else?


Computers never saves time - but they help you produce more in the same timespan...

Offline

#4 2008-03-31 12:20:29

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

Re: Autowifi - how should I make it run the scripts??? SOLVED

nahoj wrote:

This part works all right!

  Mar 31 07:45:50   autowifi-event[7861]: Interface 'eth1' connected to network 'xxx'

What does the next line say ("Using profile ...")? If the right profile is used, the autowifi_connect() function is always run when connected, I am using this with several profiles (in my case, to start a VPN client when necessary).

Offline

#5 2008-03-31 16:17:20

nahoj
Member
Registered: 2004-11-05
Posts: 30

Re: Autowifi - how should I make it run the scripts??? SOLVED

It says: 'Using profile xxx' ie it is using the correct file. But the command 'lpoptions -d MFC7820N' is not run. Is there any special way of writing the commands? I have just written them in the same manner as in console.


Computers never saves time - but they help you produce more in the same timespan...

Offline

#6 2008-03-31 16:21:30

nahoj
Member
Registered: 2004-11-05
Posts: 30

Re: Autowifi - how should I make it run the scripts??? SOLVED

Sorry! I've solved it!

I had spelled it wrong.  roll

Couldn't understand why it didn't work...

Thanks any way.


Computers never saves time - but they help you produce more in the same timespan...

Offline

#7 2008-04-06 19:57:16

philefou
Member
Registered: 2006-05-23
Posts: 15

Re: Autowifi - how should I make it run the scripts??? SOLVED

Where is gone this package?

Offline

#8 2008-04-14 19:33:54

philefou
Member
Registered: 2006-05-23
Posts: 15

Re: Autowifi - how should I make it run the scripts??? SOLVED

Looks like this is now include in the netcfg package.  http://wiki.archlinux.org/index.php/Network_Profiles

Offline

Board footer

Powered by FluxBB