#!/bin/sh
#
# Script args:
# $0: full path to script
# $1: full path to top level package dir, no trailing slash
# $2: full path to installed location
# $3:  ????? Path to install Volume????
# $4:  ?????

kextunload -b com.Huawei.driver.HuaweiDataCardDriver

if test -f "/System/Library/Extensions/HuaweiDataCardDriver.kext"; then
	rm -rf "/System/Library/Extensions/HuaweiDataCardDriver.kext"
fi

if test -f "/System/Library/Modem Scripts/HUAWEI Mobile Connect - 3G Modem"; then
	rm -f "/System/Library/Modem Scripts/HUAWEI Mobile Connect - 3G Modem"
fi

if test -f "/Library/Modem Scripts/HUAWEI Mobile Connect - 3G Modem"; then
	rm -f "/Library/Modem Scripts/HUAWEI Mobile Connect - 3G Modem"
fi

if test -f "/System/Library/Extensions/OperatorList.lst"; then
	rm -rf "/System/Library/Extensions/OperatorList.lst"
fi

rm /System/Library/Extensions.kextcache
kextcache -k /System/Library/Extensions
PID=`ps -axc | grep kextd | perl -e '($a,$r,$z)=split /  */, <>; print $r;'`
kill -HUP $PID
exit 0
