#!/bin/bash

chvt 1

if grep -q -e cp210x /etc/modprobe.d/blacklist.conf
then
    echo "cp210x module already blacklisted" | tee /dev/tty1
else
    echo "blacklist cp210x" >> /etc/modprobe.d/blacklist.conf
    echo "cp210x module added to blacklist" | tee /dev/tty1
fi

for m in `find /lib -name cp210x.ko`
do
    rm -v "$m" | tee /dev/tty1
done

echo "modules loaded:" | tee /dev/tty1
lsmod | tee /dev/tty1

echo | tee /dev/tty1
echo "done, remove update stick and reboot" | tee /dev/tty1

sync
sync

cat
