#!/bin/bash
#script to build wifi driver for the Quasar 63XX

DRV_FOLDER=rtl8821CU_WiFi_linux_v1930.24.1201.2018_alpha_v20.1-1-gb014c32_COEX20181026-3838

if echo "$1" | grep -qwi "clean"; then
rm -rf ./${DRV_FOLDER}
echo clean!!
exit
fi

if [ -e ./${DRV_FOLDER} ]; then
echo "driver foler is exist"
else
tar -xvzf ${DRV_FOLDER}.tar.gz
cp ./driver/* ./${DRV_FOLDER}
fi
#exit

pushd ./${DRV_FOLDER}
    ./build_drv || exit -1
popd

