Skip to content

Commit

Permalink
addressing feedback
Browse files Browse the repository at this point in the history
using lspci filters vs regex match for VGA controller string,
as the filters are more robust.
  • Loading branch information
toumorokoshi committed Aug 7, 2020
1 parent 3165cbc commit c3ec3b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion egpu-switcher
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function is_egpu_connected() {
declare bus2h=$(printf "%02x" $bus2d)
declare bus3h=$(printf "%01x" $bus3d)

if [ $(lspci | grep -iEc "$bus1h:$bus2h.$bus3h.*VGA compatible controller.*") -eq 1 ]; then
if [ $( (lspci -d ::0300 && lspci -d ::0302) | grep -iEc "$bus1h:$bus2h.$bus3h") -eq 1 ]; then
print_info "EGPU is ${green}connected${blank}."
gpu_connected=1
hex_id=$bus1h:$bus2h.$bus3h
Expand Down

0 comments on commit c3ec3b3

Please sign in to comment.