[packages/noip] unify init script
glen
glen at pld-linux.org
Sun Jan 27 12:54:41 CET 2013
commit d91bf111777d4800f35c73c34e152a073f71d21f
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Jan 27 13:52:37 2013 +0200
unify init script
noip.init | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/noip.init b/noip.init
index df0aef2..6dc4c67 100755
--- a/noip.init
+++ b/noip.init
@@ -23,28 +23,31 @@ if [ -f /etc/sysconfig/noip ]; then
fi
start() {
+ if [ -f /var/lock/subsys/noip ]; then
+ msg_already_runing noip
+ return
+ fi
+
if [ ! -s /etc/noip.conf ]; then
echo "You should first run $0 config to prepare configuration";
exit 3
fi
- if [ ! -f /var/lock/subsys/noip ]; then
- msg_starting noip
- daemon noip $OPTIONS
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/noip
- else
- msg_already_runing noip
- fi
+
+ msg_starting noip
+ daemon /usr/sbin/noip $OPTIONS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/noip
}
stop() {
- if [ -f /var/lock/subsys/noip ]; then
- msg_stopping noip
- killproc noip
- rm -f /var/lock/subsys/noip > /dev/null 2>&1
- else
+ if [ ! -f /var/lock/subsys/noip ]; then
msg_not_running noip
+ return
fi
+
+ msg_stopping noip
+ killproc noip
+ rm -f /var/lock/subsys/noip > /dev/null 2>&1
}
RETVAL=0
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/noip.git/commitdiff/86e51197d5a21f00bced0b731a3bf86e34c3c0b1
More information about the pld-cvs-commit
mailing list