#!/bin/bash

vga_num=`lspci |grep "VGA compatible controller"| wc -l`
pci_id=`lspci -nn |grep "Multimedia video" |cut -d ":" -f4 |cut -d "]" -f1`
path=/usr/share/glvnd/egl_vendor.d

if [ "$vga_num" ==  "1" ] && [ "$pci_id" == "7a25" ]; then
    cp "$path"/60_mesa.json "$path"/40_mesa.json
elif [ "$vga_num" == "2" ]; then
    if [ -f "$path/40_mesa.json" ]; then
        rm "$path/40_mesa.json"
    fi
else
    echo "vga is not exist!" >/dev/null
fi
