Reply
Thread Tools
Posts: 17 | Thanked: 12 times | Joined on Feb 2013
#1
Hi all,

i am trying to run this script when network interface is up on my N9:

Code:
#!/bin/sh
date >> /root/data
The script path is:

Code:
/etc/network/if-up.d/50_connect_home
The file /root/data is an existing empty file.


Upon connecting to my wlan, the file /root/data is still empty, which suggests the script does not run.

Any pointers?

Thanks,
sargas.
 

The Following User Says Thank You to sargas For This Useful Post:
ffha's Avatar
Posts: 131 | Thanked: 170 times | Joined on May 2010 @ Netherlands
#2
Forgive me if I'm wrong, for I don't have a N9 myself, but doesn't Aegis prevent modification of files owned by root, even by root itself?

Try to append the data to a file in your home folder.
 

The Following User Says Thank You to ffha For This Useful Post:
Posts: 17 | Thanked: 12 times | Joined on Feb 2013
#3
Originally Posted by ffha View Post
Forgive me if I'm wrong, for I don't have a N9 myself, but doesn't Aegis prevent modification of files owned by root, even by root itself?
I guess not since i can execute the script manually, as root, and the file gets modified.

Originally Posted by ffha View Post
Try to append the data to a file in your home folder.
Trying with /home/user/data, like sugested, has no effect either.
I think there is something more to be done than just putting the script in /etc/network/if-up.d/ but i can't figure it out.
 

The Following User Says Thank You to sargas For This Useful Post:
Posts: 2,006 | Thanked: 3,351 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#4
Quick reply...
Look up file "/etc/network/interfaces". Besides lines "address ...", "netmask ....", "gateway ...", there can also be lines "up ...." and "down ..." - to run scripts when a connection starts and stops.
Best wishes.
 
Posts: 1,048 | Thanked: 1,127 times | Joined on Jan 2010 @ Amsterdam
#5
So, what does your check for ifup look like? The condition itself, if you like, not what you do if and when the condition is met.
 

The Following User Says Thank You to anthonie For This Useful Post:
Posts: 2,006 | Thanked: 3,351 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#6
Quick reply...
Contents of file "/etc/network/interaces":
Code:
auto usb0
iface usb0 inet static
	address 192.168.2.15
	netmask 255.255.255.0
	gateway 192.168.2.14
	up /usr/lib/sdk-connectivity-tool/usbdhcpd.sh 192.168.2.14
	down /usr/lib/sdk-connectivity-tool/usbdhcpd.sh stop
With appropriate setup on PC, it allows to give Internet from PC to Harmattan device.
Best wishes.
 
Posts: 2 | Thanked: 2 times | Joined on Jan 2013 @ Russia
#7
try to set a execute bit
Code:
sudo chmod +x path_to_script
also you can try to use full path for echo instead of it's binary name
or jsut set up a PATH variable
Code:
#!/bin/sh
PATH=$PATH:/bin
 

The Following User Says Thank You to ii343hbka For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#8
Originally Posted by ii343hbka View Post
try to set a execute bit
Code:
sudo chmod +x path_to_script
This could be the cause here.
__________________
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
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 17 | Thanked: 12 times | Joined on Feb 2013
#9
Originally Posted by Wikiwide View Post
Quick reply...
Look up file "/etc/network/interfaces". Besides lines "address ...", "netmask ....", "gateway ...", there can also be lines "up ...." and "down ..." - to run scripts when a connection starts and stops.
Best wishes.
Thanks, but still not working. I have tried to add:
Code:
  
auto wlan0
        iface wlan0 inet dhcp
        up /etc/network/if-up.d/50_connect_home
to /etc/network/interfaces

Also tried just one line at end of file:
Code:
up /etc/network/if-up.d/50_connect_home
The script does not run.

Edit: fixed code tags.
 

The Following User Says Thank You to sargas For This Useful Post:
Posts: 17 | Thanked: 12 times | Joined on Feb 2013
#10
Originally Posted by peterleinchen View Post
This could be the cause here.
Thanks, but first thing i've tried was to set the script executable.
 

The Following User Says Thank You to sargas For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:27.