diff --git a/install.sh b/install.sh index 66dc675..990b345 100755 --- a/install.sh +++ b/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