RT-IPC_camera/bin/vslocal/custom_run.sh

72 lines
1.3 KiB
Bash

#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs:/komod
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
. $wifidev_config
testpath=/tmpfs/VAL_TEST/
ptztest=$testpath/ptz_test.conf
wifitest=$testpath/wifi_test.conf
#####################WIFI custom test##########################
if [ -x $wifitest ];then
echo -e "\033[45;37m[VAL_TEST]Begin custom WIFI test\033[0m"
sleep 40
#######还原WIFI配置
mv $wifi_config.bak $wifi_config
echo -e "\033[45;37m[VAL_TEST]custom WIFI finished !!!!!!!!!!!!!!!\033[0m"
fi
while [ 1 ]
do
if [ ! -e /tmpfs/vs_server.pid ]
then
sleep 3
else
sleep 15
break
fi
done
#####################PTZ custom test##########################
if [ -x $ptztest ];then
chmod +x $ptztest
. $ptztest
echo -e "\033[45;37m[VAL_TEST]Begin custom PTZ test\033[0m"
if [ $cnt -ge 40 ]
then
sleep 5
else
cnt=`expr 40 - $cnt`
sleep $cnt
fi
if [ -z $speed ]
then
speed=0
fi
if [ -z $action ]
then
action=1
fi
if [ "$action" == "1" ]
then
wget -O /tmpfs/wget.log "http://127.0.0.1/cgi-bin/hi3510/setptzcfg.cgi?&-chn=0&-patrols=notLimit&-panspd=${speed}&-tiltspd=${speed}&-save=0"
sleep 1
wget -O /tmpfs/wget.log "http://127.0.0.1/cgi-bin/hi3510/ptzctrl.cgi?&-chn=0&-act=hvscan"
fi
fi
echo -e "\033[45;37m[VAL_TEST]Exit custom test\033[0m"