2024-06-27 05:08:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-06-27 07:24:32 +00:00
|
|
|
if [[ $1 == "Debian" ]]; then
|
|
|
|
|
|
|
|
echo "$1 Sudo Setup"
|
|
|
|
while [[ true ]]; do
|
2024-06-27 18:14:32 +00:00
|
|
|
if [[ ! -z $(grep $2 /etc/passwd) ]]; then
|
|
|
|
echo "usermod -aG sudo $2"
|
|
|
|
if [[ -f /home/$2/ ]]; then
|
2024-06-27 07:24:32 +00:00
|
|
|
echo "Home exists"
|
|
|
|
else
|
|
|
|
echo "Home doesn't Exist"
|
|
|
|
fi
|
|
|
|
break
|
|
|
|
else
|
|
|
|
read -p "Invalid Username. Use an valid existing username." username
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
elif [[ $1 == "Arch" ]]; then
|
|
|
|
|
|
|
|
echo "$1 Sudo Setup"
|
|
|
|
while [[ true ]]; do
|
2024-06-27 18:14:32 +00:00
|
|
|
if [[ ! -z $(grep $2 /etc/passwd) ]]; then
|
|
|
|
echo "usermod -aG wheel $2"
|
|
|
|
if [[ -f /home/$2/ ]]; then
|
2024-06-27 07:24:32 +00:00
|
|
|
echo "Home exists"
|
|
|
|
else
|
|
|
|
echo "Home doesn't Exist"
|
|
|
|
fi
|
|
|
|
break
|
|
|
|
else
|
|
|
|
read -p "Invalid Username. Use a valid existing username:" username
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|