Tuesday, September 19, 2017

Adding new Web Developer Users - dev_user.sh


#!/bin/bash
#Check if Root
if [ $UID -ne 0 ]; then
  echo "Please sudo first....!"
  exit
else
  if [ -z "$1" ]; then
    echo "Enter username"
  else 
    adduser $1 
    usermod -a -G sudo $1
    usermod -g www-data $1
    su - $1
    git config --global core.editor nano
    /bin/echo "Enter Full Name:"
    read fullname
    git config --global user.name "$fullname"
    /bin/echo "Enter Email Address:"
    read email
    git config --global user.email "$email"
  fi
fi  

No comments:

Post a Comment