steffen: server/kolabd/kolabd/namespace/libexec adduser.in, NONE, 1.1 deluser.in, NONE, 1.1 listusers.in, NONE, 1.1 newconfig.in, NONE, 1.1 services.in, NONE, 1.1 showlog.in, NONE, 1.1 showuser.in, NONE, 1.1 start.in, NONE, 1.1 stop.in, NONE, 1.1 adduser, 1.2, NONE deluser, 1.1.1.1, NONE listusers, 1.1.1.1, NONE newconfig, 1.1.1.1, NONE services, 1.1.1.1, NONE showlog, 1.1.1.1, NONE showuser, 1.1.1.1, NONE start, 1.1.1.1, NONE stop, 1.1.1.1, NONE

cvs at intevation.de cvs at intevation.de
Tue Sep 13 16:38:24 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolabd/kolabd/namespace/libexec
In directory doto:/tmp/cvs-serv22600/kolabd/namespace/libexec

Added Files:
	adduser.in deluser.in listusers.in newconfig.in services.in 
	showlog.in showuser.in start.in stop.in 
Removed Files:
	adduser deluser listusers newconfig services showlog showuser 
	start stop 
Log Message:
kolabd autoconfiscated!

--- NEW FILE: adduser.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

if [ ".$1" = ".--showhelp" ]; then
	echo "Add a user mailbox"
	exit 0
	HASHELP
fi

#Collect some vitals
SERVER=127.0.0.1

BINDDN=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_dn :" | sed -e "s;bind_dn : ;;"`
BINDPW=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_pw :" | sed -e "s;bind_pw : ;;"`
BASEDN=`cat @sysconfdir@/kolab/kolab.conf | grep "base_dn :" | sed -e "s;base_dn : ;;"`
HOMESERV=`cat @sysconfdir@/kolab/kolab.conf | grep "fqdnhostname :" | sed -e "s;fqdnhostname : ;;"`

echo "Please specify the firstname:"
read FIRSTNAME
echo "Please specify the lastname:"
read LASTNAME
echo "Please specify the email address:"
read EMAIL
echo "Please specify the password:"
read PASSWORD
echo "Please specify the quota (kb):"
read QUOTA

CN="$FIRSTNAME $LASTNAME"
SN="$LASTNAME"

#Sanity checks
if test "$FIRSTNAME" = ""; then
echo "You must specify a firstname"
exit 255
fi
if test "$LASTNAME" = ""; then
echo "You must specify a lastname"
exit 255
fi
if test "$EMAIL" = ""; then
echo "You must specify a valid mail address"
exit 255
fi
if test "$PASSWORD" = ""; then
echo "You must specify a password"
exit 255
fi

#Echo to user - last chance
echo "--"
echo "About to add the following user:"
echo "Name: $CN"
echo "Mail: $EMAIL"
echo "Password: $PASSWORD"
if test "$QUOTA" != ""; then
echo "Quota: ${QUOTA}kb"
fi
echo "--"

#Check if the user already exists
DN=`@bindir@/kolab showuser $EMAIL | grep dn`
if test "$DN" != ""; then
echo User already found! Or other error occurred.
exit 255
fi

echo "Are you sure you want to proceed? (y/n)"
read ANS
if test "$ANS" != "y"; then
echo Aborted
exit 255
fi



#Create the ldif
LDIFFILE="/tmp/cfadduser.ldif"
trap "rm $LDIFFILE" 0 1 2 3 15

cat <<LDIF > $LDIFFILE
dn: cn=$CN,$BASEDN
objectClass: top
objectClass: inetOrgPerson
objectClass: kolabInetOrgPerson
mail: $EMAIL
uid: $EMAIL
sn: $LASTNAME
givenName: $FIRSTNAME
cn: $CN
userPassword: $PASSWORD
kolabHomeServer: $HOMESERV
LDIF

if test "$QUOTA" != ""; then
echo "userquota: $QUOTA" >> $LDIFFILE
fi

@bindir@/ldapadd -x -D "$BINDDN" -w $BINDPW -h $SERVER -f $LDIFFILE

--- NEW FILE: deluser.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##


if [ ".$1" = ".--showhelp" ]; then
	echo "Delete a user mailbox"
	exit 0
	HASHELP
fi

#Collect some vitals
SERVER=127.0.0.1

BINDDN=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_dn :" | sed -e "s;bind_dn : ;;"`
BINDPW=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_pw :" | sed -e "s;bind_pw : ;;"`
BASEDN=`cat @sysconfdir@/kolab/kolab.conf | grep "base_dn :" | sed -e "s;base_dn : ;;"`
HOMESERV=`cat @sysconfdir@/kolab/kolab.conf | grep "fqdnhostname :" | sed -e "s;fqdnhostname : ;;"`

DN=`@bindir@/kolab showuser $1 | grep dn`
if test "$DN" = ""; then
echo User not found! 
exit 255
else
	echo $DN
	echo Are you sure you want to delete this user?
	read ANS
	if test "$ANS" != "y"; then
		exit 0
	fi
fi


LDIFFILE="/tmp/cfdeluser.ldif"
trap "rm $LDIFFILE" 0 1 2 3 15

cat <<LDIF > $LDIFFILE
$DN
add: kolabdeleteflag
kolabdeleteflag: $HOMESERV
LDIF

@bindir@/ldapmodify -x -D "$BINDDN" -w $BINDPW -h $SERVER -f $LDIFFILE 

--- NEW FILE: listusers.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##


if [ ".$1" = ".--showhelp" ]; then
	echo "Display a list of mailboxes"
	exit 0
	HASHELP
fi

server=127.0.0.1
binddn=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_dn :" | sed -e "s;bind_dn : ;;"`
bindpw=`cat @sysconfdir@/kolab/kolab.conf | grep "bind_pw :" | sed -e "s;bind_pw : ;;"`
basedn=`cat @sysconfdir@/kolab/kolab.conf | grep "base_dn :" | sed -e "s;base_dn : ;;"`


@bindir@/ldapsearch -x -LLL -b "$basedn" -D "$binddn" -w $bindpw -h $server "(&(objectClass=kolabInetOrgPerson)(mail=*))" mail | grep mail | sed -e "s;mail: ;;"

--- NEW FILE: newconfig.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

if [ ".$1" = ".--showhelp" ]; then
	echo "Propogate changes made to Kolab templates"
	exit 0
	HASHELP
fi

@sbindir@/kolabconf

--- NEW FILE: services.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##


if [ ".$1" = ".--showhelp" ]; then
	echo "Display a list of services"
	exit 0
	HASHELP
fi


services=`ls @kolab_rcdir@/`
echo "${services}" | sed -e 's/rc\.//'



--- NEW FILE: showlog.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

# can be removed (i think) won't be needed
# prefix=@prefix@

if [ ".$1" = ".--showhelp" ]; then
	echo "Display the Kolab server logs"
	exit 0
	HASHELP
fi

#list of logfiles, maintainers please update
logfiles="
@ftpserver_logfile@
@amavisd_logfile@
@fsl_logfile@
@sasl_logfile@
@resmgr_logfile@
@freebusy_logfile@
@clamav_logfile@
@imap_masterlogfile@
@imap_misclogfile@
@webserver_errorlogfile@
@webserver_accesslogfile@
@ldapserver_logfile@
@postfix_logfile@
"

if [ ".$PAGER" = "." ]; then
	PAGER=less
fi


if [ ".$1" = "." ]; then
	for log in $logfiles; do
		echo $log 
	done
	echo
	echo "To view a log please specify the <logname> or \"-t <logname>\""
	echo "It is also possible to abbreviate the logname, for example:"
	echo "\"showlog postfix\" will display the postfix log."
else 
	if [ ".$1" = ".-t" ]; then
		PAGER="tail -f "
		if [ ".$2" = "." ]; then
			exit 0;
		else
			showme=$2
		fi
	else 
		showme=$1
	fi
		
	for log in $logfiles; do
		match=`echo $log | grep $showme`
		if [ ".$match" != "." ]; then
			$PAGER $log
		fi
	done
fi


--- NEW FILE: showuser.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

if [ ".$1" = ".--showhelp" ]; then
	echo "Display information on a user"
	exit 0
	HASHELP
fi

server=127.0.0.1
binddn=`cat ${prefix}/etc/kolab/kolab.conf | grep "bind_dn :" | sed -e "s;bind_dn : ;;"`
bindpw=`cat ${prefix}/etc/kolab/kolab.conf | grep "bind_pw :" | sed -e "s;bind_pw : ;;"`
basedn=`cat ${prefix}/etc/kolab/kolab.conf | grep "base_dn :" | sed -e "s;base_dn : ;;"`


if [ ".$1" = "." ]; then
	echo "Please specify an email address"
	exit 2
fi

@bindir@/ldapsearch -x -LLL -b "$basedn" -D "$binddn" -w $bindpw -h $server "(&(objectClass=kolabInetOrgPerson)(mail=$1))"

--- NEW FILE: start.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

prefix=@prefix@

if [ ".$1" = ".--showhelp" ]; then
	echo "Start the server"
	exit 0
	HASHELP
fi


${prefix}/bin/openpkg rc all start

--- NEW FILE: stop.in ---
##  Copyright (c) 2004  Code Fusion cc
##
##  This  program is free  software; you can redistribute  it and/or
##  modify it  under the terms of the GNU  General Public License as
##  published by the  Free Software Foundation; either version 2, or
##  (at your option) any later version.
##
##  This program is  distributed in the hope that it will be useful,
##  but WITHOUT  ANY WARRANTY; without even the  implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
##  General Public License for more details.
##
##  You can view the  GNU General Public License, online, at the GNU
##  Project's homepage; see <http://www.gnu.org/licenses/gpl.html>.
##

prefix=@prefix@

if [ ".$1" = ".--showhelp" ]; then
	echo "Stop the server"
	exit 0
	HASHELP
fi


${prefix}/bin/openpkg rc all stop

--- adduser DELETED ---

--- deluser DELETED ---

--- listusers DELETED ---

--- newconfig DELETED ---

--- services DELETED ---

--- showlog DELETED ---

--- showuser DELETED ---

--- start DELETED ---

--- stop DELETED ---





More information about the commits mailing list