#!/bin/sh

usage () {
   echo "Usage: $0 <project> <user>"
   echo "project: med|junior|desktop|edu|demudi"
   echo "user:    user of the system who should be deleted from the project"
}


if [ _"$1"_ == __ ] ; then
   echo "Missing project name."
   usage
   exit -1
fi

if [ _"$2"_ == __ ] ; then
   echo "Missing user name."
   usage
   exit -1
fi

PROJ=$1
case "$PROJ" in
   "med"|"MED")   
            PROJECT="med"
            ;;
   "junior"|"JUNIOR")
            PROJECT="junior"
	    ;;
   "desktop"|"DESKTOP")
            PROJECT="desktop"
	    ;;
   "edu"|"EDU")
            PROJECT="desktop"
	    ;;
   "demudi"|"DEMUDI")
            PROJECT="demudi"
	    ;;
   "lex"|"LEX")
            PROJECT="lex"
            ;;
   "nonprofit"|"NONPROFIT")
            PROJECT="nonprofit"
            ;;
   *)
            echo "Wrong project name $PROJ."
            usage
	    exit -1
	    ;;
esac

PROJUSER=$2

deluser ${PROJUSER} ${PROJ} 

echo Now ${PROJUSER} is removed from project ${PROJ}.
