On Tuesday 05 October 2004 05:11, Rikard Johnels wrote:
On Tuesday 05 October 2004 04.17, Leendert Meyer wrote:
On Tuesday 05 October 2004 01:55, Rikard Johnels wrote:
On Tuesday 05 October 2004 00.01, Leendert Meyer wrote:
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
... All i need is to run "jdsl -l" to login (and "jdsl -o" to logout) from the ADSL, and make sure no-ip runs after that. The last thing is the script (which loads a few iptables rules i need.)
First of all, I am unfamiliar with ADSL. But there is a YaST DSL module, did you already check it out?
Yes. But this setup is for a standalone firewall with a bare minimum setup. My ADSL uses a plain network logon via a webpage. The jdsl just sends all the relevant info to the page for a login
And second, no-ip implies that you don't have a permanent connection, do you? So to me it seems the better place for the no-ip binary would be in /etc/sysconfig/network/if-{up,down}.d/.
It is "semi-permanent" Its a dhcp connection, but its up 24/7 so i tend to keep the ip for an extended period of time (last count over 300 days)
Ok, I've thought this over a bit, and I think it is best to go to the if-{up,down}.d directories, because the binaries you use need to be run right after the link is up, and before other services make use of the connection. I think it would be difficult to insert an init.d script at the right place, without modification of other init.d scripts. It's quite simple. Here is a small template script: ----8<----[if-adsl.sh]----8<---- #! /bin/bash # script is called with these kind of arguments: # $1 = "eth-id-xx:xx:xx:xx:xx:xx" # $2 = "eth0" # $3 = "-o" # fill in your ADSL interface: INT="eth0" # Do nothing if the interface isn't right: [ "$2" != "$INT" ] && exit D="${0%/*}" D="${D##*/}" case $D in if-up.d) echo "Bringing interface $INT up..." # I'm guessing here: jdsl -l no-ip ;; if-down.d) echo "Bringing interface $INT down..." # I'm guessing here: no-ip jdsl -o ;; esac ---->8---->8---->8---->8---- Save this file as e.g. /usr/local/bin/if-adsl.sh then: $ F="/usr/local/bin/if-adsl.sh" $ chmod +x $F $ ln -s $F /etc/sysconfig/network/if-up.d/ $ ln -s $F /etc/sysconfig/network/if-down.d/ I've tested this setup on my own pc, and it seems to work well. Cheers, Leen