Hi Guys,
I have one script which is used to add new user in the system.
This is how we add new user in system:-
Code:
sudo /opt/local/bin/new-user 114 ranivarm "Rani Varma(Libo Technical User)" INC00001111
Where
114:-is the site id
ranivarm:- is userid
"Rani Varma(Libo Technical User)" :- comment
INC00001111:- ticket number
The script is little big, so here is part of that script:-
Code:
case $steps2skip in
(help) die "$advanced";;
(password) steps2skip=124;;
(enable) steps2skip=123;;
([1-4]*) ;;
esac
username=${1:?username required: $usage} shift
ticket=$3
descr="$*"
#
# assertions
#
grep -c ${group} /etc/group >/dev/null ||
warn "Warning: group $group is not in /etc/group"
grep -c $shell /etc/shells >/dev/null ||
warn "Warning: shell $shell is not in /etc/shells"
warn "Checking accountname ${username:?}"
if [[ $steps2skip = *1* ]]; then
/bin/logins -xol $username ||
die "account $username does not exist!"
/bin/getent passwd ${username} ||
die "account $username does not exist!"
eval home=~${username}
else : step 1: creating /etc/passwd entry
/bin/getent passwd ${username} &&
die "account $username already exists!"
/bin/logins -xol $username
Could you please tell me what entry should I enter and where should I insert it?
Thanks
Peter