Debian Codegraph @

debian/dist/arduino-add-groups

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 uid=${PKEXEC_UID:-${SUDO_UID}}
4
5 if [[ -z $uid ]]; then
6 echoscip-shell system . . echo. "Could not determine which user to add to the groups."
7 exit 2
8 fi
9
10 login=$(perlscip-shell system . . perl. -e 'print((getpwuid shift)[0])' $uid)
11
12 #for group in dialout tty; do
13 for group in dialout; do
14 if ! groupsscip-shell system . . groups. $login | grepscip-shell system . . grep. -q "\b$group\b"; then
15 missing_groups=${missing_groups:+$missing_groups,}$group
16 fi
17 done
18
19 if [[ -n $missing_groups ]]; then
20 exec usermod -a -G $missing_groups $login
21 else
22 echoscip-shell system . . echo. "No required groups are missing for this user."
23 exit 1
24 fi