View previous topic :: View next topic |
Author |
Message |
yuilsa n00b
Joined: 11 Mar 2005 Posts: 54
|
Posted: Fri Sep 30, 2005 7:39 am Post subject: passing options to init script [Solved by Workaround] |
|
|
I use ddclient to update my dyndns info. I have both a customDNS account and the free version. The program does not allow me to do both types in the same conf file. My solution was to have two instances of ddclient running.
So, I made ddclient2.conf with the proper adjustments. Then, I copied /etc/init.d/ddclient to /etc/init.d/ddclient2
I need to pass some options but I can't get it to work:
Code: |
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.rc6,v 1.4 2004/07/14 23:21:59 agriffis Exp $
depend() {
need net
}
checkconfig() {
if [ ! -e /etc/ddclient/ddclient2.conf ] ; then
eerror "You need a /etc/ddclient/ddclient2.conf file to run ddclient"
eerror "There is a sample file in /etc/ddclient/"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting DDClient2"
start-stop-daemon --start --quiet --exec "/usr/sbin/ddclient -file /etc/ddclient/ddclient2.conf"
eend $?
}
stop() {
ebegin "Stopping DDClient"
start-stop-daemon --stop --quiet --pidfile /var/run/ddclient2.pid
eend $?
}
|
"/usr/sbin/ddclient -file /etc/ddclient/ddclient2.conf" is the line in question.
With the quotes, with single-quotes and without any quotes, I still cannot get this init-script to load properly. So how do I pass this argument?
Thanks.
Last edited by yuilsa on Fri Sep 30, 2005 4:38 pm; edited 1 time in total |
|
Back to top |
|
|
yuilsa n00b
Joined: 11 Mar 2005 Posts: 54
|
Posted: Fri Sep 30, 2005 4:37 pm Post subject: |
|
|
I made /usr/sbin/ddclient2
Code: | #!/bin/bash
/usr/sbin/ddclient -file /etc/ddclient/ddclient2.conf |
$ chmod 755 /usr/sbin/ddclient2
And just called this file in make init script.
Code: | #!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/ddclient/files/ddclient.rc6,v 1.4 2004/07/14 23:21:59 agriffis Exp $
depend() {
need net
}
checkconfig() {
if [ ! -e /etc/ddclient/ddclient2.conf ] ; then
eerror "You need a /etc/ddclient/ddclient2.conf file to run ddclient"
eerror "There is a sample file in /etc/ddclient/"
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting DDClient2"
start-stop-daemon --start --quiet --exec "/usr/sbin/ddclient2"
eend $?
}
stop() {
ebegin "Stopping DDClient"
start-stop-daemon --stop --quiet --pidfile /var/run/ddclient2.pid
eend $?
} |
Now, I have two versions of ddclient running. One updates my customDNS and one updates my dynamic dyndns address. |
|
Back to top |
|
|
|
|
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
|
|