#!/bin/bash TELEGRAM_BIN="$HOME/.local/bin/telegram/Telegram/Telegram" LLX_TELEGRAM="/usr/bin/telegram" TELEGRAM_EPI="/usr/share/zero-lliurex-telegram/telegram.epi" USER=$(id -un $PKEXEC_UID) CHECK_GROUP=$(id -nG $USER ) AUTH_GROUP=0 AUTH_GROUP_LIST=("students" "alu") eval "CHECK_GROUP_LIST=($CHECK_GROUP)" for item in "${CHECK_GROUP_LIST[@]}";do gr=$(echo "$item" |awk '{print tolower($0)}') for i in "${AUTH_GROUP_LIST[@]}";do if [[ "$gr" == *"$i"* ]]; then AUTH_GROUP=1 break fi done if [ $AUTH_GROUP -eq 1 ];then break fi done if [ $AUTH_GROUP -eq 0 ];then if [ -e "$TELEGRAM_BIN" ]; then exec $LLX_TELEGRAM else exec /usr/share/zero-center/zmds/zero-lliurex-telegram.zmd fi fi