File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,31 +137,4 @@ else
137137 sudo usermod --add-subuids " $id_range " --add-subgids " $id_range " " $username "
138138fi
139139
140- # 8. Add users to groups owning device nodes
141- echo " Adding user to the device node owning groups..."
142- devices=(" /dev/kvm" " /dev/vhost-net" " /dev/vhost-vsock" )
143- groups_to_add=()
144- for dev in " ${devices[@]} " ; do
145- if [ ! -e " $dev " ]; then
146- echo " Error: Required device $dev does not exist."
147- exit 1
148- fi
149- group=$( stat -c " %G" " $dev " )
150- if [[ -z " $group " || " $group " == " root" ]]; then
151- echo " Error: Invalid group name of $dev to add user into the group."
152- exit 1
153- fi
154- if ! id -nG " $username " | grep -qw " $group " ; then
155- groups_to_add+=(" $group " )
156- fi
157- done
158- if [ ${# groups_to_add[@]} -gt 0 ]; then
159- unique_groups=($( echo " ${groups_to_add[@]} " | tr ' ' ' \n' | sort -u | tr ' \n' ' ' ) )
160- for unique_group in " ${unique_groups[@]} " ; do
161- sudo usermod -aG " $unique_group " " $username "
162- done
163- echo " Warning: Please reboot the machine (or log out and log back in) before using podcvd."
164- echo " Your current session does not have active membership in all required device groups."
165- fi
166-
167140echo " Setup complete! You can now run 'podcvd'."
You can’t perform that action at this time.
0 commit comments