#!/bin/bash # Simple script to avoid the creation of a conditional udev rule. # I need to blacklist intel_agp if there's a nvidia card inserted. . /lib/lsb/init-functions if [ `lspci | grep Intel |grep Graphics\ Controller | wc -l ` -gt 0 ] then if [ `lspci | grep VGA | grep nVidia | wc -l` -gt 0 ] then log_begin_msg "Blacklisting intel in favor of nVidia" mount / -o rw,remount status=$? echo "blacklist intel_agp" > /etc/modprobe.d/blacklist-nvidia let "status = $status +$?" mount / -o ro,remount let "status = $status +$?" log_end_msg $status else mount / -o rw,remount rm /etc/modprobe.d/blacklist-nvidia mount / -o ro,remount fi fi exit 0