Files
xkm-server/center_server_900/tools/tapp_frame/create_tapp.sh
2025-05-21 13:43:08 +08:00

38 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
usage()
{
echo "Usage: "
echo " $0 TappName"
echo " "
echo "Example: "
echo " $0 tqosproxy "
}
if [ $# -ne 1 ]; then
echo "paramter list uncorrect"
usage
exit 1
fi
if test "$1" == "--help" || test "$1" == "-h" ; then
usage
exit 0
fi
rm -rf ${1}
mkdir ${1}
APP_BIG=`echo $1 | tr a-z A-Z`
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/temple.c > ${1}/${1}.c
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/temple_conf_desc.xml > ${1}/${1}_conf_desc.xml
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/temple.xml > ${1}/${1}.xml
cp ./temple/Makefile ${1}/
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/conv.sh > ${1}/conv.sh
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/Makefile.real > ${1}/Makefile.real
#sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/version.h > ${1}/version.h
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/start_temple.sh > ${1}/start_${1}.sh
sed -e "s/TEMPLE_ORI/$1/g" -e "s/TEMPLE_BIG/$APP_BIG/g" ./temple/stop_temple.sh > ${1}/stop_${1}.sh
chmod +x ${1}/*.sh