summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Bos <richard@radoeka.nl>2009-02-21 21:53:51 (GMT)
committerRichard Bos <richard@radoeka.nl>2009-02-21 21:53:51 (GMT)
commit54c0dde9979c3d931384c48cfb7ac648a88d4e20 (patch)
treebeaf8daf35f468e9fb1ff9f991eee88f01c049b4
parent3c79b5ae1b41812b7f52fff2460f34120c24cade (diff)
downloadkolab-conf-54c0dde9979c3d931384c48cfb7ac648a88d4e20.tar.gz
dist_conf/kolabsrv.in: added argument checks, source in the file
/etc/kolab/profile.sh if it exists dist_conf/suse: assigned a value to kolab_quotawarning
-rw-r--r--conf/dist/kolabsrv.in79
-rw-r--r--conf/dist/suse1
2 files changed, 70 insertions, 10 deletions
diff --git a/conf/dist/kolabsrv.in b/conf/dist/kolabsrv.in
index 4610793..76948dc 100644
--- a/conf/dist/kolabsrv.in
+++ b/conf/dist/kolabsrv.in
@@ -32,6 +32,9 @@ function rcrun() {
# map distribution specific rc script names
function getServiceName() {
sname=$1
+ # Perhaps better use:
+ # lsb_release -i | cut -d" " -f2
+ # (be aware of the tab....)
if [ -e /etc/SuSE-release ]; then
case $sname in
openldap) SERVICE="@LDAPD@" ;;
@@ -46,24 +49,80 @@ function getServiceName() {
# variables
RC=$1
+SERVICE=$2
+PARAM=$3
+
+# Use the service name as defined in the openpkg environment
+# Kolab installations on native distributions, should adap service names
+# with the function getServiceName
+SERVICES="@LDAPD@ saslauthd spamd amavisd apache2 freshclam cyrus postfix"
+SERVICES="$SERVICES clamav kolabd"
case $RC in
- rc) ;; # okay
- *) echo "ERROR: $1 not supported";;
+rc)
+ # okay
+ ;;
+*)
+ SERVICES=$(echo $SERVICES | tr -s " " | sed 's, ,|,'g)
+
+ ( echo "ERROR: $RC not supported"
+ echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+ ) >&2
+
+ exit 1
+ ;;
esac
-if [[ "$2" == "all" ]]; then
- SERVICES="@LDAPD@ saslauthd spamd amavis apache2 freshclam clamd cyrus postfix"
- SERVICES="$SERVICES kolabd"
-else
- SERVICES=$2
+if [[ "$SERVICE" != "all" ]]; then
+
+ SERVICE_FOUND=no
+
+ for S in $SERVICES; do
+ if [[ $S == "$SERVICE" ]]; then
+ SERVICE_FOUND=yes
+ SERVICES=$SERVICE
+ break
+ fi
+ done
+
+ if [[ $SERVICE_FOUND == "no" ]]; then
+ ( echo "ERROR: unknown service: $SERVICE"
+ echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+ ) >&2
+
+ exit 1
+ fi
fi
-PARAM=$3
+[[ -f @sysconfdir@/kolab/profile.sh ]] && . @sysconfdir@/kolab/profile.sh
+
RCDIR=@kolab_rcdir@
for SERVICE in $SERVICES; do
- getServiceName $SERVICE
- check $SERVICE
+ # Only start the virus scanning dependent services in case
+ # virus scannning has been enabled on the kolab web admin interface.
+ # An service is always stopped independent of the virus service
+ # scanning setting.
+ if [[ "$PARAM" == "start" ]] || [[ "$PARAM" == "restart" ]]; then
+ case $SERVICE in
+ amavisd|clamav|freshclam|spamd)
+ if [[ "$ENABLE_VIRUS_SCAN" == "no" ]]; then
+ RUN_SERVICE=no
+ else
+ RUN_SERVICE=yes
+ fi
+ ;;
+ *)
+ RUN_SERVICE=yes
+ ;;
+ esac
+ else
+ RUN_SERVICE=yes
+ fi
+
+ [[ $RUN_SERVICE == "yes" ]] && {
+ getServiceName $SERVICE
+ check $SERVICE
+ }
done
diff --git a/conf/dist/suse b/conf/dist/suse
index 61a37ca..4dbc6b5 100644
--- a/conf/dist/suse
+++ b/conf/dist/suse
@@ -93,6 +93,7 @@ kolab_scriptsdir=$(datadir)/kolab/scripts
kolab_php_module_prefix=kolab/
kolab_php_smarty_prefix=Smarty
smarty_compiledir=${phplibdir2}/${kolab_php_module_prefix}admin/templates_c
+kolab_quotawarning=${sysconfdir}/kolab/quotawarning.txt
# Kolab web user interface
kolab_wui=/kolab