#!/bin/bash
#
#
#    Scalix Public License
#
#
#    The contents of this file are subject to the Scalix Public License
#    Version 1.1 ("License"); you may not use this file except in
#    compliance with the License. You may obtain a copy of the License at
#
# 
#    http://www.scalix.com/community/licensing 
#
# 
#    Software distributed under the License is distributed on an "AS IS"
#    basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
#    the License for the specific language governing rights and limitations
#    under the License.
#
# 
#    The Original Code is Scalix Server. 
#    The Initial Developer of the Original Code is Scalix Corporation. 
#    Copyright (C) 2006 Scalix Corporation. 
#    All Rights Reserved.
#    Additional Copyrights may apply - see the notice in each file
#
#
#
#
#
#
# Copyright (C) 2006 Scalix Corporation.  All Rights Reserved.
#
# usage function
#
usage() {
	echo "usage: $0 [--help]"
	exit 2
}

help() {
	echo ""
	echo ""
	echo "VERSION:" 
	echo "1.0"
	echo ""
	echo "NAME:" 
	echo "Add Users"
	echo ""
	echo "DESCRIPTION:"
	echo ""
	echo "This script adds users with the names provided to the mailnode provided using omaddu"
	echo "PARAMETERS:"
	echo "--mailnode	Mailnode	otterNode	string	single	Usage Information"
	echo "--user	User Name	Sasha	string	multi	Names of users to add"
	echo "--help	Help	\"\"	\"\"	\"\"	Usage Information"
	echo ""
	echo "OUTPUT:"
	echo ""
	echo "text/plain"
}
#
# main script
#

declare mailnode;
mailnode=otterNode;
while [ "$1" != "" ]; do
	case "$1" in
		--help) help;
			shift;;
		--mailnode) mailnode=$2;
                            shift;;
                --user) /opt/scalix/bin/omaddu -n $2/$mailnode
                        shift;;
                *) usage;;
	esac
	shift
done
exit 0
