Active Topics

 


Reply
Thread Tools
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#1
I created a simple upstart script:

Code:
start on started wl1251-cal
stop on starting shutdown
console none

script
    exec macchanger (params)
end-script
Even though, after a full bootup, the mac address stays the same. I used wl1251-cal because it is said to be the last, according to the wiki. [1]

Btw. why does setting `console log` makes upstart not accept the script (unknown job)

[1] http://wiki.maemo.org/Maemo_5_boot_process
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#2
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 ...
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2014-09-04 at 20:06.
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
wicket's Avatar
Posts: 634 | Thanked: 3,266 times | Joined on May 2010 @ Colombia
#3
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.
__________________
DebiaN900 - Native Debian on the N900. Deprecated in favour of Maemo Leste.

Maemo Leste for N950 and N9 (currently broken).
Devuan for N950 and N9.

Mobile devices with mainline Linux support - Help needed with documentation.

"Those who do not understand Unix are condemned to reinvent it, poorly." - Henry Spencer

Last edited by wicket; 2014-09-07 at 20:04.
 

The Following 3 Users Say Thank You to wicket For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#4
@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.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#5
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
$ ip link set dev "$interface" address "$mac_address"
$ ip link set dev "$interface" up
or

Code:
$ ifconfig "$interface" down
$ ifconfig "$interface" hw ether "$mac_address"
$ ifconfig "$interface" up
 

The Following 9 Users Say Thank You to pali For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#6
Will adding
Code:
auto wlan0
iface wlan0 inet dhcp
       hwadresss ether xx:xx:xx:xx:xx:xx
to /etc/network/interfaces do the trick?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
wicket's Avatar
Posts: 634 | Thanked: 3,266 times | Joined on May 2010 @ Colombia
#7
Originally Posted by marmistrz View Post
Will adding
Code:
auto wlan0
iface wlan0 inet dhcp
       hwadresss ether xx:xx:xx:xx:xx:xx
to /etc/network/interfaces do the trick?
Almost. Try it without the word "ether". I've had this working under Debian on the N900.
__________________
DebiaN900 - Native Debian on the N900. Deprecated in favour of Maemo Leste.

Maemo Leste for N950 and N9 (currently broken).
Devuan for N950 and N9.

Mobile devices with mainline Linux support - Help needed with documentation.

"Those who do not understand Unix are condemned to reinvent it, poorly." - Henry Spencer

Last edited by wicket; 2014-09-26 at 23:07.
 

The Following 2 Users Say Thank You to wicket For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#8
Originally Posted by marmistrz View Post
I used wl1251-cal because it is said to be the last, according to the wiki. [1]
Besides the other comments you've received, I just wanted to note that wl1251-cal is only executed if the state is TEST, which is (basically) never the case.

You need to follow the "USER" path. You could use e.g. "hildon-desktop" or "wlancond" or "icd2" as trigger.
 

The Following 4 Users Say Thank You to reinob For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#9
I had no time to post the results

My /etc/network/interfaces is

Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto usb0
iface usb0 inet static
        address 192.168.2.15
        netmask 255.255.255.0
        gateway 192.168.2.14
		
auto wlan0
iface wlan0 inet dhcp
        hwaddress xx:xx:xx:xx:xx:xx
But after booting up the MAC adress is stock...
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following User Says Thank You to marmistrz For This Useful Post:
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#10
Maemo does not use /etc/network/interfaces for wifi configuration, so that file is basically ignored.
 

The Following 5 Users Say Thank You to pali For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 19:08.