|
@@ -5,9 +5,9 @@
|
|
|
# Creates a new user for administrative purposes (in sudo group)
|
|
# Creates a new user for administrative purposes (in sudo group)
|
|
|
#
|
|
#
|
|
|
cat <<EOF
|
|
cat <<EOF
|
|
|
-##################################
|
|
|
|
|
-# Creating default user #
|
|
|
|
|
-##################################
|
|
|
|
|
|
|
++---------------------------------------------+
|
|
|
|
|
+| Creating default user |
|
|
|
|
|
++---------------------------------------------+
|
|
|
EOF
|
|
EOF
|
|
|
read -p "Please enter default user name: " the_user
|
|
read -p "Please enter default user name: " the_user
|
|
|
|
|
|
|
@@ -24,9 +24,11 @@ fi
|
|
|
|
|
|
|
|
if [ 0 -ne "$status" ]
|
|
if [ 0 -ne "$status" ]
|
|
|
then
|
|
then
|
|
|
- echo "Error creating $the_user"
|
|
|
|
|
- echo "Please try again by rebooting"
|
|
|
|
|
|
|
+ echo "### Error creating $the_user ###"
|
|
|
|
|
+ echo "### Please try again by rebooting your system ###"
|
|
|
|
|
+ exit 1
|
|
|
else
|
|
else
|
|
|
|
|
+ # Adds new user to sudo group
|
|
|
adduser $the_user sudo
|
|
adduser $the_user sudo
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -37,17 +39,13 @@ do
|
|
|
status=$?
|
|
status=$?
|
|
|
if [ 0 -ne "$status" ]
|
|
if [ 0 -ne "$status" ]
|
|
|
then
|
|
then
|
|
|
- echo "Error changing $the_user password"
|
|
|
|
|
|
|
+ echo "# Error changing $the_user password #"
|
|
|
echo "Please try again"
|
|
echo "Please try again"
|
|
|
else
|
|
else
|
|
|
- cat <<EOF
|
|
|
|
|
-************************************
|
|
|
|
|
-* $the_user : created successfully *
|
|
|
|
|
-************************************
|
|
|
|
|
-EOF
|
|
|
|
|
|
|
+ echo "> $the_user : created successfully <"
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
done
|
|
done
|
|
|
|
|
|
|
|
-echo "An error occurred changing $the_user password"
|
|
|
|
|
|
|
+echo "### An error occurred changing $the_user password ###"
|
|
|
exit $status
|
|
exit $status
|