#!/bin/bash
# auth: xiluhua
# date: -- read -p "please input a username:" username
[ -z $username ] && echo "a username is needed" && exit if id $username &> /dev/null
then
echo $username 'is exist'
fi read -p "please input the passward:" passward
[ -z $passward ] && echo "a passward is needed" && exit useradd $username
echo "$passward" | passwd --stdin $username &> /dev/null
echo "add $username finished"