Code: Select all
#!/bin/bash
#
# Nuno Mesquita.
#
help() {
echo ""
echo ""
echo "VERSION:"
echo "1.0"
echo ""
echo "NAME:"
echo "Change User MailNode"
echo ""
echo "DESCRIPTION:"
echo ""
echo "ommodu changes user attributes."
echo "PARAMETERS:"
echo "-u User string single User Name"
echo "-n New Mailnode string single New Mailnode of the User"
echo "-a AuthenticationID string single User Authentication ID"
echo "--help Help \"\" \"\" \"\" Usage Information"
echo ""
echo "OUTPUT:"
echo ""
echo "text/plain"
}
#
# main script
#
declare params
declare authenticationid
declare Newmailnode
declare user
params=""
authenticationid=""
Newmailnode=""
user=""
while [ "$1" != "" ]; do
case "$1" in
--help) help;
exit 0
shift;;
-u) user="$2";
shift;;
-n) Newmailnode="$2";
shift;;
-a) authenticationid="$2";
shift;;
*) params="$params $1 $2";
shift;;
esac
shift
done
/opt/scalix/bin/omshowu -n "$user" > /dev/null
if [ "$?" = "0" ]; then
echo "/opt/scalix/bin/ommodu -o "$user/$Newmailnode" $authenticationid"
/opt/scalix/bin/ommodu -n "$user/$Newmailnode" $authenticationid
fi
exit 0