Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rc.script help please
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mmartin
n00b
n00b


Joined: 08 Nov 2002
Posts: 45

PostPosted: Mon Mar 03, 2003 8:56 pm    Post subject: rc.script help please Reply with quote

Hi there,

I read thru the rc.script guide and made the following script:

Code:

#!/sbin/runscript

depend() {
        need net
}

start() {
        ebegin "Starting VPN (Studenteheim Donaufeld)"
        /usr/sbin/pptp-command start donaufeld
        /sbin/route del default
        /sbin/route add default gw 192.168.10.1
        eend $? "Failed to start VPN (Studentenheim Donaufeld)"
}
stop() {
        ebegin "Stopping VPN (Studenteheim Donaufeld)"
        /sbin/route del default
        /usr/sbin/pptp-command stop donaufeld
        eend $? "Failed to stop VPN (Studentenheim Donaufeld)"
}


Now my first question is, is the "need net" ok when i want the script to start after the network is up, i havent found any info on which keywords i can use so i just guessed, but I think its ok since need net appears in the rc-script guide.

2.) can i simply start the script the way I did? I read something about passing options but didn't get the point, sry lack of english :oops:

3.) the sample script does "kill (cat /var/foo.pid)", do I have to do that for some reason or is it ok to just let the pptp client shutdown?

the goal is to just type rc-update add vpn default to have my vpn connectin started at boot up after the network is up.

pls help me I know lots of questions but hey at least I'm trying ;)
_________________
thxMartin

Man honest. Will do everything.
Tired of cleaning yourself? - Let me do it.
Eat a frog in the morning and nothing worse will happen to you that day
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum