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
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "Add tablet group..."
|
set -eu
|
||||||
/usr/sbin/groupadd tablet
|
|
||||||
|
GROUP=tablet
|
||||||
|
|
||||||
|
if ! [ $(getent group "$GROUP") ]; then
|
||||||
|
echo "Add tablet group..."
|
||||||
|
/usr/sbin/groupadd tablet
|
||||||
|
fi
|
||||||
|
|
||||||
read -p "Enter your local username: " user
|
read -p "Enter your local username: " user
|
||||||
|
|
||||||
echo "Add user to group..."
|
if ! [ $(groupmems -g "$GROUP" -l | grep "$user" ) ]; then
|
||||||
usermod -a -G tablet "$user"
|
echo "Add user to group..."
|
||||||
|
usermod -a -G tablet "$user"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Copy files..."
|
echo "Copy files..."
|
||||||
cp -r tabletmode/ /usr/local/lib/python3.11/dist-packages
|
cp -r tabletmode/ /usr/local/lib/python3.11/dist-packages
|
||||||
|
|
Loading…
Reference in a new issue