|
@@ -113,23 +113,23 @@ function altaUsuario {
|
|
|
if [ ! -z $otherGroups ]; then
|
|
|
opciones=$opciones" -G $otherGroups"
|
|
|
fi
|
|
|
- if [ -z $password ]; then
|
|
|
- igual=false
|
|
|
- while [ $igual = false ]; do
|
|
|
- printf "(PASSWORD)> "
|
|
|
- read -s password
|
|
|
- printf "\n(Confirme PASSWORD)> "
|
|
|
- read -s password2
|
|
|
- printf "\n"
|
|
|
- if [ $password = $password2 ]; then
|
|
|
- igual=true
|
|
|
- else
|
|
|
- printf "ERROR: No coinciden. Vuelva a intentarlo.\n"
|
|
|
- fi
|
|
|
- done
|
|
|
- unset igual password2
|
|
|
- fi
|
|
|
- opciones=$opciones" -p $password"
|
|
|
+ #if [ -z $password ]; then
|
|
|
+ # igual=false
|
|
|
+ # while [ $igual = false ]; do
|
|
|
+ # printf "(PASSWORD)> "
|
|
|
+ # read -s password
|
|
|
+ # printf "\n(Confirme PASSWORD)> "
|
|
|
+ # read -s password2
|
|
|
+ # printf "\n"
|
|
|
+ # if [ $password = $password2 ]; then
|
|
|
+ # igual=true
|
|
|
+ # else
|
|
|
+ # printf "ERROR: No coinciden. Vuelva a intentarlo.\n"
|
|
|
+ # fi
|
|
|
+ # done
|
|
|
+ # unset igual password2
|
|
|
+ #fi
|
|
|
+ #opciones=$opciones" -p $password"
|
|
|
if [ -z $shell ]; then
|
|
|
printf "Shells disponibles:\n"
|
|
|
for linea in $(grep -v "#" /etc/shells); do
|
|
@@ -170,6 +170,12 @@ function altaUsuario {
|
|
|
printf "ERROR FATAL: No se ha podido crear el usuario (codigo salida: $?).\n"
|
|
|
return 1
|
|
|
fi
|
|
|
+ #Cambiamos usuario
|
|
|
+ cambiarPassword
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
+ printf "ERROR: al establecer contraseña (usuario creado).\n"
|
|
|
+ return 1
|
|
|
+ fi
|
|
|
return 0
|
|
|
}
|
|
|
|