[csw-devel] SF.net SVN: gar:[5221] csw/mgar/pkg/dante/trunk/files/CSWdante.cswdante

skayser at users.sourceforge.net skayser at users.sourceforge.net
Wed Jun 10 12:14:06 CEST 2009


Revision: 5221
          http://gar.svn.sourceforge.net/gar/?rev=5221&view=rev
Author:   skayser
Date:     2009-06-10 10:14:06 +0000 (Wed, 10 Jun 2009)

Log Message:
-----------
dante: revamped init script

Modified Paths:
--------------
    csw/mgar/pkg/dante/trunk/files/CSWdante.cswdante

Modified: csw/mgar/pkg/dante/trunk/files/CSWdante.cswdante
===================================================================
--- csw/mgar/pkg/dante/trunk/files/CSWdante.cswdante	2009-06-10 08:20:10 UTC (rev 5220)
+++ csw/mgar/pkg/dante/trunk/files/CSWdante.cswdante	2009-06-10 10:14:06 UTC (rev 5221)
@@ -13,31 +13,46 @@
 
 case $1 in
         'start')
-                if [ -f "$CONFIG" ]; then
-                        /opt/csw/sbin/sockd -D -f $CONFIG
-                else
-                        echo "No config file ($CONFIG). Not starting cswdante."
+		printf "Starting SOCKS proxy: cswdante ... "
+                if [ ! -f "$CONFIG" ]; then
+                        echo "no configuration, not starting"
+			exit 96
                 fi
+		/opt/csw/sbin/sockd -D -f $CONFIG; RC=$?
+		if [ $RC -ne 0 ]; then
+			echo "failed"
+			exit $RC
+		else
+			echo "ok"
+		fi
                 ;;
         'stop')
+		printf "Stopping SOCKS proxy: cswdante ... "
                 if [ -f "$PIDFILE" ]; then
                         /usr/bin/kill `/usr/bin/cat $PIDFILE`
-                fi
+			echo "ok"
+                else
+			echo " no pid file, not running?"
+		fi
                 ;;
         'restart')
-                # Kill everything
                 $0 stop
                 $0 start
                 ;;
         'reload')
                 # Make the parent process reload the config file, but leave
                 # child processes untouched.
+		printf "Reloading SOCKS proxy: cswdante ... "
                 if [ -f "$PIDFILE" ]; then
                         /usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
-                fi
+                else
+			echo " no pid file, not running?"
+		fi
                 ;;
         *)
                 echo "Usage: $0 { start | stop | restart | reload }"
                 exit 1
                 ;;
 esac
+
+exit 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list