summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Bos <richard@radoeka.nl>2009-11-08 13:55:24 (GMT)
committerRichard Bos <richard@radoeka.nl>2009-11-08 13:55:24 (GMT)
commitbd07a91585c08140f3b3d9ddf2c76cd77253ea18 (patch)
treeb9fceb8e27f8a3c192a34b74a8f95687956318d4
parentb02045665efbdf7f602472d91d2c35a14b540471 (diff)
downloadkolab-conf-bd07a91585c08140f3b3d9ddf2c76cd77253ea18.tar.gz
added list option, to show the involved distribution related service,
and whether they are active or no.
-rw-r--r--conf/dist/kolabsrv.in49
1 files changed, 43 insertions, 6 deletions
diff --git a/conf/dist/kolabsrv.in b/conf/dist/kolabsrv.in
index efca5df..b2161bd 100644
--- a/conf/dist/kolabsrv.in
+++ b/conf/dist/kolabsrv.in
@@ -1,5 +1,7 @@
#!@BASH@
+PRGNAME=$(basename $0)
+
# check if everything is correct
function check() {
if [ -x "$RCDIR/$SERVICE" ]; then
@@ -22,7 +24,7 @@ function rcrun() {
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 @@ function getServiceName() {
fi
}
+[[ -f /etc/kolab/profile.sh ]] && . /etc/kolab/profile.sh
+
# variables
RC=$1
SERVICE=$2
@@ -74,11 +78,46 @@ case $RC in
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" != "all" ]]; then
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
@@ -110,8 +149,6 @@ else
fi
fi
-[[ -f @sysconfdir@/kolab/profile.sh ]] && . @sysconfdir@/kolab/profile.sh
-
RCDIR=@kolab_rcdir@
for SERVICE in $SERVICES; do