Skip to content

Instantly share code, notes, and snippets.

@WaaromZoMoeilijk
Created June 14, 2016 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WaaromZoMoeilijk/b1ad1001117ab8cafce8cf1c0836b528 to your computer and use it in GitHub Desktop.
Save WaaromZoMoeilijk/b1ad1001117ab8cafce8cf1c0836b528 to your computer and use it in GitHub Desktop.
# Check if the user ncadmin exists, if not create it. This option for installs other then the pre-configured VM
ret=false
getent passwd $UNIXUSER >/dev/null 2>&1 && ret=true
if $ret; then
echo
echo "User $UNIXUSER exists..."
echo
else
adduser --gecos GECOS $UNIXUSER << EOF
$UNIXPASS
$UNIXPASS
y
EOF
usermod -aG sudo $UNIXUSER
echo
echo "User $UNIXUSER created..."
echo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment