#!/bin/sh
#filename:autopack.sh


if [ -d  /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleUSBEthernet.kext ]
then
sudo mkdir /asix_temp
sudo cp -R /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleUSBEthernet.kext /asix_temp/AppleUSBEthernet.kext
sudo kextunload /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleUSBEthernet.kext
sudo rm -rf /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleUSBEthernet.kext
sudo chmod -R 755 /asix_temp/AppleUSBEthernet.kext
sudo chown -R root:wheel /asix_temp/AppleUSBEthernet.kext
fi

if [ -d  /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AX88772.kext ]
then
sudo kextunload /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AX88772.kext
sudo rm -rf /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AX88772.kext
fi

if [ -d /System/Library/Extensions/AppleUSBEthernet.kext ]
then
sudo kextunload /System/Library/Extensions/AppleUSBEthernet.kext
sudo rm -rf /System/Library/Extensions/AppleUSBEthernet.kext
fi

if [ -d /System/Library/Extensions/AX88772.kext ]
then
sudo kextunload /System/Library/Extensions/AX88772.kext
sudo rm -rf /System/Library/Extensions/AX88772.kext
fi