1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/sh if [ $# -ne 1 ]; then echo "Invalid args" >&2 exit 1 fi case $1 in add|ADD) #hopefully this prevents infinite loops like bug #454740 if lsmod | grep -iq nvidia; then /opt/bin/nvidia-smi > /dev/null fi ;; remove|REMOVE) rm -f /dev/nvidia* ;; esac exit 0