Skip to content

Instantly share code, notes, and snippets.

@WaaromZoMoeilijk
Created June 14, 2016 21:41
Show Gist options
  • Select an option

  • Save WaaromZoMoeilijk/b1ad1001117ab8cafce8cf1c0836b528 to your computer and use it in GitHub Desktop.

Select an option

Save WaaromZoMoeilijk/b1ad1001117ab8cafce8cf1c0836b528 to your computer and use it in GitHub Desktop.

Revisions

  1. Ezra created this gist Jun 14, 2016.
    22 changes: 22 additions & 0 deletions addusers
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # 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