Check if we found a free uid.

This commit is contained in:
Stefan Berggren 2016-08-11 23:28:59 +02:00
parent 3369e8fda5
commit da980ed894

View file

@ -74,6 +74,7 @@ next_passwd_uid() {
PASSWD_UID=$(next_passwd_uid) PASSWD_UID=$(next_passwd_uid)
log "Add $1 ($2) to master.passwd with UID $PASSWD_UID" log "Add $1 ($2) to master.passwd with UID $PASSWD_UID"
[ -z $PASSWD_UID ] && abort "No free UID found"
co -u master.passwd co -u master.passwd
echo "$1:*:$PASSWD_UID:30::0:0:$2:/afs/stacken.kth.se/home/$1:/bin/bash" \ echo "$1:*:$PASSWD_UID:30::0:0:$2:/afs/stacken.kth.se/home/$1:/bin/bash" \
>> master.passwd >> master.passwd