When to change MAC using an Upstart script
I created a simple upstart script:
Code:
start on started wl1251-cal Btw. why does setting `console log` makes upstart not accept the script (unknown job) [1] http://wiki.maemo.org/Maemo_5_boot_process |
Re: When to change MAC using an Upstart script
First:
What about exec rights of script? Second: it is not end-script but end script Third: you do not need exec and script block single command via exec multi commands via script ... end script Just put a simple echo $(date) >> /log.log and maybe a to be tuned sleep 10 before macchanger (params) for debugging ... |
Re: When to change MAC using an Upstart script
Is there a particular reason for why you need to change the MAC address with a script?
I've not tried it (on Maemo) but it should be possible to configure the MAC address directly in the /etc/network/interfaces file using the hwaddress option. |
Re: When to change MAC using an Upstart script
@peterleinchen: yes, it's end script, I wrote it from memory, permission 0755, owner - root.
@wicket: Always changed it with macchanger and there was written somewhere, that to permanently change address, you should make an upstart script. I'll try moving to pure exec for curiosity's sake, but I think I'll use wicket's suggestion. |
Re: When to change MAC using an Upstart script
Here are commands how to change mac address only with standard linux tools which are installed everywhere now:
Code:
$ ip link set dev "$interface" down Code:
$ ifconfig "$interface" down |
Re: When to change MAC using an Upstart script
Will adding
Code:
auto wlan0 |
Re: When to change MAC using an Upstart script
Quote:
|
Re: When to change MAC using an Upstart script
Quote:
You need to follow the "USER" path. You could use e.g. "hildon-desktop" or "wlancond" or "icd2" as trigger. |
Re: When to change MAC using an Upstart script
I had no time to post the results ;)
My /etc/network/interfaces is Code:
auto lo |
Re: When to change MAC using an Upstart script
Maemo does not use /etc/network/interfaces for wifi configuration, so that file is basically ignored.
|
Re: When to change MAC using an Upstart script
So what's the best option to permanently (i.e. until I reflash) change the mac address?
|
Re: When to change MAC using an Upstart script
Its not easy, because mac address is set by program wl1251-cal which is spawned from wlancond daemon. So I think best option is to create upstart script which will be started after wlancond starts. That script will wait e.g 5 seconds (to make sure that wlancond exec wl1251-cal) and after that set new mac address.
|
Re: When to change MAC using an Upstart script
And what about adding this as the last entry in the wlancond script?
|
Re: When to change MAC using an Upstart script
this means modification to file which is part of wlancond package which is in cssu, so can be overwritten by next update.
|
Re: When to change MAC using an Upstart script
And is it possible to detect wl1251-cal exit?
|
Re: When to change MAC using an Upstart script
only via ptrace(2)
|
All times are GMT. The time now is 10:49. |
vBulletin® Version 3.8.8