
function get_free_uid_sys() {

local UIDsIN_USE=$(cut -d: -f3 < /etc/passwd)
local i=$SYS_UID_MIN
 while [ $i -le $SYS_UID_MAX ]
 do

    if [ "$(echo "$UIDsIN_USE" | grep -c "^$i$" )" -eq "0" ] ; then     
       break
    fi
 
 ((i++))
 
 done
echo $i
}
