-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmac_usr_setup.sh
More file actions
executable file
·32 lines (23 loc) · 902 Bytes
/
mac_usr_setup.sh
File metadata and controls
executable file
·32 lines (23 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Setting up a user account
echo "Creating a new user:"
echo "Enter user shorthand (3 letters):"
read USR_HANDLE
if [[ -z $USR_HANDLE || ${#USR_HANDLE} != 3 ]]; then
echo "User handle incorrect, please try running the script again..."
exit 1
fi
echo "Enter user full name:"
read FULL_NAME
echo "Enter user password:"
read -s USR_PASS
echo "Confirm user password:"
read -s USR_PASS_CONFIRM
if [[ $USR_PASS != $USR_PASS_CONFIRM ]]; then
echo "Passwords do not match, please try running the script again..."
exit 1
fi
echo "You will be prompted for ADMIN password in a moment..."
sudo sysadminctl -addUser "${USR_HANDLE}" -fullName "${FULL_NAME}" -password "${USR_PASS}"
echo "Now please login into the new account and complete the initial account setup using the UI"
echo "Once the user setup is complete log back into the admin account and run the rest of the scripts."