summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Portnoy <avenj@gentoo.org>2003-12-03 21:22:21 +0000
committerJon Portnoy <avenj@gentoo.org>2003-12-03 21:22:21 +0000
commit3a15cb1a018cd4e9fbf07c596c4cad3179f77a02 (patch)
treedf063f63510ffeb22e8306b174da2e3392755037 /net-misc/portfwd/files
parentLots of updates from bug 33994 - thanks Alessandro Pisani (diff)
downloadgentoo-2-3a15cb1a018cd4e9fbf07c596c4cad3179f77a02.tar.gz
gentoo-2-3a15cb1a018cd4e9fbf07c596c4cad3179f77a02.tar.bz2
gentoo-2-3a15cb1a018cd4e9fbf07c596c4cad3179f77a02.zip
Lots of updates from bug 33994 - thanks Alessandro Pisani
Diffstat (limited to 'net-misc/portfwd/files')
-rw-r--r--net-misc/portfwd/files/digest-portfwd-0.26_rc6-r11
-rw-r--r--net-misc/portfwd/files/portfwd.confd3
-rw-r--r--net-misc/portfwd/files/portfwd.init32
3 files changed, 26 insertions, 10 deletions
diff --git a/net-misc/portfwd/files/digest-portfwd-0.26_rc6-r1 b/net-misc/portfwd/files/digest-portfwd-0.26_rc6-r1
new file mode 100644
index 000000000000..c7fcf062a2fa
--- /dev/null
+++ b/net-misc/portfwd/files/digest-portfwd-0.26_rc6-r1
@@ -0,0 +1 @@
+MD5 9706c8c4c4551c079f3e76abf985b64d portfwd-0.26rc6.tar.gz 135300
diff --git a/net-misc/portfwd/files/portfwd.confd b/net-misc/portfwd/files/portfwd.confd
new file mode 100644
index 000000000000..7e1ac3b3fb4f
--- /dev/null
+++ b/net-misc/portfwd/files/portfwd.confd
@@ -0,0 +1,3 @@
+# See `man portfwd` for options.
+
+PORTFWD_OPTS="-f -t"
diff --git a/net-misc/portfwd/files/portfwd.init b/net-misc/portfwd/files/portfwd.init
index 3fc7de2452e2..f9c4bd7922f0 100644
--- a/net-misc/portfwd/files/portfwd.init
+++ b/net-misc/portfwd/files/portfwd.init
@@ -1,27 +1,39 @@
#!/sbin/runscript
-# $Header: /var/cvsroot/gentoo-x86/net-misc/portfwd/files/portfwd.init,v 1.2 2003/11/20 19:20:06 avenj Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/portfwd/files/portfwd.init,v 1.3 2003/12/03 21:22:18 avenj Exp $
depend() {
need net
}
checkconfig() {
- if [ ! -e /etc/portfwd.cnf ] ; then
- eerror "You need an /etc/portfwd.cnf file first"
+ if [ ! -e /etc/portfwd.cfg ] ; then
+ eerror "You need an /etc/portfwd.cfg file first"
eerror "There are samples in the documentation directory"
return 1
fi
}
start() {
- checkconfig || return 1
- ebegin "Starting portfwd"
- start-stop-daemon --start --quiet --exec /usr/sbin/portfwd -- -t -f
- eend $?
+ checkconfig || return 1
+ ebegin "Starting portfwd"
+ start-stop-daemon --start --quiet --pidfile /var/run/portfwd.pid --exec /usr/sbin/portfwd -- ${PORTFWD_OPTS}
+
+ _pid="`ps --no-heading -C 'portfwd' -o pid | head -n 1`"
+ if [ -n "$_pid" ] ; then
+ echo "${_pid/ /}" > /var/run/portfwd.pid
+ eend 0
+ else
+ eend 1
+ fi
}
stop() {
- ebegin "Stopping portfwd"
- start-stop-daemon --stop --quiet --pidfile /var/run/portfwd.pid
- eend $?
+ ebegin "Stopping portfwd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/portfwd.pid
+
+ if [ $? -eq 0 ]; then
+ rm -f /var/run/portfwd.pid
+ fi
+
+ eend $?
}