richard: server/kolabd/kolabd/dist_conf kolabsrv.in,1.18,1.19

cvs at kolab.org cvs at kolab.org
Sun Nov 8 14:55:26 CET 2009


Author: richard

Update of /kolabrepository/server/kolabd/kolabd/dist_conf
In directory doto:/tmp/cvs-serv18811/dist_conf

Modified Files:
	kolabsrv.in 
Log Message:
added list option, to show the involved distribution related service,
and whether they are active or no.



Index: kolabsrv.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/dist_conf/kolabsrv.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- kolabsrv.in	3 May 2009 19:40:14 -0000	1.18
+++ kolabsrv.in	8 Nov 2009 13:55:24 -0000	1.19
@@ -1,5 +1,7 @@
 #!@BASH@
 
+PRGNAME=$(basename $0)
+
 # check if everything is correct
 function check() {
 	if [ -x "$RCDIR/$SERVICE" ]; then
@@ -22,7 +24,7 @@
 	retc=$?
 	if [ $retc -ne 0 ] && [ $retc -ne 3 ]; then
 		( echo "ERROR: $RCDIR/$SERVICE $PARAM failed"
-		  echo "Run: @KOLABRC@ rc all stop"
+		  echo "Run: $PRGNAME rc all stop"
 		  echo "to stop all services"
 		) >&2
 		exit 1
@@ -59,6 +61,8 @@
 	fi
 }	
 
+[[ -f /etc/kolab/profile.sh ]] && . /etc/kolab/profile.sh
+
 # variables
 RC=$1
 SERVICE=$2
@@ -74,11 +78,46 @@
 rc)
 	# okay
 	;;
+list)
+	for S in $SERVICES; do
+		getServiceName $S
+		case $S in
+		amavisd|clamav|freshclam|spamd)
+			DEFENSIVE_SERVICES="$DEFENSIVE_SERVICES $SERVICE"
+			;;
+		*)
+			GROUPWARE_SERVICES="$GROUPWARE_SERVICES $SERVICE"
+			;;
+		esac
+	done
+
+	echo "Groupware services:"
+	echo "-------------------"
+	chkconfig --list $GROUPWARE_SERVICES
+	echo "All the above listed groupware services must be active."
+	echo
+
+	echo "Defensive services:"
+	echo "-------------------"
+	chkconfig --list $DEFENSIVE_SERVICES
+
+	if [[ "$ENABLE_VIRUS_SCAN" == "no" ]]; then
+		echo "SPAM detection and virus scanning are disabled."
+		echo "Hence the above listed defensive services do not need to be active."
+	else
+		echo "SPAM detection and virus scanning are enabled."
+		echo "The above listed defensive services must be active."
+	fi
+	exit
+	;;
 *)
 	SERVICES=$(echo $SERVICES | tr -s " " | sed 's, ,|,'g)
 
-	( echo "ERROR: $RC not supported"
-	  echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+	( [[ -n "$RC" ]] && echo "ERROR: $RC not supported"
+	  echo "Use: $PRGNAME rc [all|$SERVICES] [stop|start|restart|status]"
+	  echo
+	  echo "Display the state of the all kolab related processes:"
+	  echo "  $PRGNAME list"
 	) >&2
 
 	exit 1
@@ -99,7 +138,7 @@
 
 	if [[ $SERVICE_FOUND == "no" ]]; then
 		( echo "ERROR: unknown service: $SERVICE"
-		  echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+		  echo "Use: $PRGNAME rc [all|$SERVICES] [stop|start|restart|status]"
 		) >&2
 
 		exit 1
@@ -109,8 +148,6 @@
 		SERVICES=$(tr " " "\n" <<< "$SERVICES" | tac)
 	fi
 fi
-
-[[ -f @sysconfdir@/kolab/profile.sh ]] && . @sysconfdir@/kolab/profile.sh
 
 RCDIR=@kolab_rcdir@
 





More information about the commits mailing list