Only add group and user if they don't exist
This commit is contained in:
parent
5a8657d7ca
commit
5488f154e1
1 changed files with 12 additions and 4 deletions
16
install.sh
16
install.sh
|
@ -1,12 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Add tablet group..."
|
||||
/usr/sbin/groupadd tablet
|
||||
set -eu
|
||||
|
||||
GROUP=tablet
|
||||
|
||||
if ! [ $(getent group "$GROUP") ]; then
|
||||
echo "Add tablet group..."
|
||||
/usr/sbin/groupadd tablet
|
||||
fi
|
||||
|
||||
read -p "Enter your local username: " user
|
||||
|
||||
echo "Add user to group..."
|
||||
usermod -a -G tablet "$user"
|
||||
if ! [ $(groupmems -g "$GROUP" -l | grep "$user" ) ]; then
|
||||
echo "Add user to group..."
|
||||
usermod -a -G tablet "$user"
|
||||
fi
|
||||
|
||||
echo "Copy files..."
|
||||
cp -r tabletmode/ /usr/local/lib/python3.11/dist-packages
|
||||
|
|
Loading…
Reference in a new issue