![]() |
Running script when network interface is up
Hi all,
i am trying to run this script when network interface is up on my N9: Code:
#!/bin/sh Code:
/etc/network/if-up.d/50_connect_home Upon connecting to my wlan, the file /root/data is still empty, which suggests the script does not run. Any pointers? Thanks, sargas. |
Re: Running script when network interface is up
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. |
Re: Running script when network interface is up
Quote:
Quote:
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. |
Re: Running script when network interface is up
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. |
Re: Running script when network interface is up
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.
|
Re: Running script when network interface is up
Quick reply...
Contents of file "/etc/network/interaces": Code:
auto usb0 Best wishes. |
Re: Running script when network interface is up
try to set a execute bit
Code:
sudo chmod +x path_to_script or jsut set up a PATH variable Code:
#!/bin/sh |
Re: Running script when network interface is up
Quote:
|
Re: Running script when network interface is up
Quote:
Code:
Also tried just one line at end of file: Code:
up /etc/network/if-up.d/50_connect_home Edit: fixed code tags. |
Re: Running script when network interface is up
Quote:
|
Re: Running script when network interface is up
may be /var/log/syslog might show something
|
Re: Running script when network interface is up
Quick reply...
Copy your script from if-up.d directory to another directory, and change file's name. Point "up ..." line of "/etc/network/interfaces" to the copy outside if-up.d . See if it helps. If no, reboot and see if it helps. http://manpages.ubuntu.com/manpages/...erfaces.5.html Best wishes. |
Re: Running script when network interface is up
Thanks all for your time.
Since i am not able to pull this off i'm thinking to do it old school: daemon runs in background, pings 8.8.8.8 at regular interval and, if network is up, sends some data to a remote ssh server. This way it doesn't matter which interface is up - data gets sent anyway. If you're wandering, this is poor man's "track and protect". :D Edit: typo. |
Re: Running script when network interface is up
Quote:
Here is the answer from thedead1440 about this specific problem. This is a new to-be-executed binary/shell and this needs to be entered to refhashlist to be excuted by system (afaiu). Quote:
|
All times are GMT. The time now is 03:06. |
vBulletin® Version 3.8.8