mirror of
https://gitlab.com/amrron/setup-scripts.git
synced 2026-10-17 01:54:00 -04:00
fixed dialout function
tweaked vara setup script for more testing
This commit is contained in:
+19
-3
@@ -477,14 +477,30 @@ echo "100% Complete"
|
||||
function add_dialout() {
|
||||
|
||||
if [[ $PLAT = "Linuxmint" ]]; then
|
||||
if $(id | grep dialout); then
|
||||
echo "User already a member of Dialout"; return
|
||||
else
|
||||
CHK_DIALOUT=$(id -nG | grep dialout)
|
||||
|
||||
if [ -z "$CHK_DIALOUT" ]; then
|
||||
echo "Adding user to dialout group"
|
||||
sudo usermod -a -G dialout $USER ||
|
||||
{ ERRCODE="Unable to add user to dialout group. You will need to run sudo usermod -a -G dialout $USER"; errors; return; }
|
||||
else
|
||||
echo "User already a member of dialout group."
|
||||
fi
|
||||
fi
|
||||
|
||||
MYUSER=$(whoami)
|
||||
CHK_DIALOUT=$(id -nG | grep dialout)
|
||||
CHK_TTY=$(id -nG | grep tty)
|
||||
CHK_AUDIO=$(id -nG | grep audio)
|
||||
|
||||
if [ -z "$CHK_DIALOUT" ]; then
|
||||
echo "Adding user to dialout group"
|
||||
sudo usermod -a -G dialout $MYUSER ||
|
||||
{ ERRCODE="Failed to add user to dialout group"; errors; }
|
||||
else
|
||||
echo "User already in dialout group"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user