#!/bin/sh
. ../../target.def

if [ "$1" = "edimax" ]; then
	rm -rf ./web-cl/graphics ./web-cl/set.css ./web ./LINUX/config-cl.txt
	ln -s web-cl web
	cp -rf ./vsion-cl/edimax ./web/graphics
	if [ $? != 0 ]; then
		echo "copy file error!!"
		exit 1
	fi
	cp -f ./vsion-cl/edimax.css ./web/set.css
	if [ $? != 0 ]; then
		echo "copy file error!!"
		exit 1
	fi
	rm -rf ./web/graphics/CVS
	cp -f ./vsion-cl/config/config-general-cl.txt ./LINUX/config-cl.txt
	echo "Set version to English Edimax successfully..."
	exit 0
fi

if [ "$1" = "general" ]; then
	rm -rf ./web-cl/graphics ./web-cl/set.css ./web ./LINUX/config-cl.txt
	ln -s web-cl web
	cp -rf ./vsion-cl/general ./web/graphics
	if [ $? != 0 ]; then
		echo "copy file error!!"
		exit 1
	fi
	cp -f ./vsion-cl/general.css ./web/set.css
	if [ $? != 0 ]; then
		echo "copy file error!!"
		exit 1
	fi
	rm -rf ./web/graphics/CVS
	cp -f ./vsion-cl/config/config-general-cl.txt ./LINUX/config-cl.txt
	echo "Set version to English General successfully..."
	exit 0
fi

if [ "$1" = "hawking" ]; then
#	rm -rf ./web-cl-hawking/graphics ./web-cl-simplified/set.css ./web #../LINUX/config-cl.txt
	rm -rf ./web ./LINUX/config-cl.txt
	ln -s web-cl-hawking web
#	cp -rf ./vsion-cl/simpGeneral ./web/graphics
#	if [ $? != 0 ]; then
#		echo "copy file error!!"
#		exit 1
#	fi
#	cp -f ./vsion-cl/simpGeneral.css ./web/set.css
#	if [ $? != 0 ]; then
#		echo "copy file error!!"
#		exit 1
#	fi
#	rm -rf ./web/graphics/CVS
	cp -f ./vsion-cl/config/config-hawking-cl.txt ./LINUX/config-cl.txt
	echo "Set version to English Hawking successfully..."
	exit 0
fi

if [ "$1" = "help" ]; then
	echo " usage: set [arg]"
	echo " edimax          Set version to English Edimax, Model number is 00."
	echo " general         Set version to English General, Model number is 01."
	echo " hawking         Set version to English Hawking, Model number is 11."
	echo " help            Show help for you"
	exit 1
fi

echo "Module no support!!"
exit 1
	
