add files

This commit is contained in:
Cyberes 2023-03-31 22:47:53 -06:00
parent 28bc84d859
commit 5619c020b7
121 changed files with 37643 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
echo -e "Content-Type:text/plain\r"
echo -e "\r"
ap_config=/etc/network/wifiap.conf
apname="`cat $ap_config | grep ap_name | cut -d'=' -f2`"
apname="`echo $apname | awk -F" " '{print $2}'`"
echo var apname =\"${apname}\"\;

View File

@ -0,0 +1,19 @@
#!/bin/sh
DDNSCONF=/etc/ipcamera/ddns.conf
DDNSENABLE=/etc/ipcamera/ddns_enable.conf
. $DDNSCONF
. $DDNSENABLE
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "var ddnsdomain = \"$DDNS_DOMAINNAME\" ;\r"
echo -e "var ddnsusername = \"$DDNS_USERNAME\" ;\r"
echo -e "var ddnspassword = \"$DDNS_USERPASSWORD\" ;\r"
echo -e "var ddnsispname = \"$DDNS_ISPNAME\" ;\r"
echo -e "var ddnsdnsserver = \"$DDNS_DNSSERVER\" ;\r"
echo -e "var ddnsisproxy = \"$DDNS_ISPROXY\" ;\r"
echo -e "var ddnsenable = \"$DDNS_ENABLE\" ;\r"
echo -e "\r"

View File

@ -0,0 +1,68 @@
#!/bin/sh
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
IFCONF=/etc/network/ifattr
IFRESOLV=/etc/resolv.conf
NETDEV=/tmpfs/netdev
. $IFCONF
iface=`cat $NETDEV`
if [ ${dhcp} = "y" ];then
dhcpflag=on
elif [ ${dhcp} = "n" ];then
dhcpflag=off
fi
if [ ${dnstype} = "server" ] ; then
dnsstat=1
elif [ ${dnstype} = "specify" ] ; then
dnsstat=0
fi
DNS1=`grep nameserver $IFRESOLV | sed -n '1 s/^nameserver *//'p`
DNS2=`grep nameserver $IFRESOLV | sed -n '2 s/^nameserver *//'p`
#MAC=`ip address show eth0|awk '/link\/ether/ {print $2}'`
####BT ipinfo=`ifconfig $iface | grep "inet addr"`
####BT address=`echo $ipinfo | awk '{print $2}'| sed -n "s/addr://p"`
####BT netmask=`echo $ipinfo | awk '{print $4}'| sed -n "s/Mask://p"`
####BT gateway=`route | awk -v k="$iface" '{if ($1=="default" && $8==k) print $2}' `
if [ $iface = eth0 ];then
NETTYPE=LAN
else
NETTYPE=WIRELESS
fi
if [ "$1" != "nohead" ]
then
echo -e "Content-Type:text/plain\r"
echo -e "\r"
fi
####BT echo -e "var dhcpflag = \"$dhcpflag\" ;\r"
####BT echo -e "var ip = \"$address\" ;\r"
####BT echo -e "var netmask = \"$netmask\" ;\r"
####BT echo -e "var gateway = \"$gateway\" ;\r"
####BT echo -e "var macaddress = \"$MAC\" ;\r"
cat $ip_cache1
####BT -e "var dnsstat = \"$dnsstat\" ;\r"
echo -e "var fdnsip = \"$DNS1\" ;\r"
echo -e "var sdnsip = \"$DNS2\" ;\r"
####BTecho -e "var networktype = \"$NETTYPE\" ;\r"
##echo -e "var httpport = \"80\" ;\r"
if [ "$1" != "nohead" ]
then
echo -e "\r"
fi

56
bin/vslocal/cgi-bin/getip Normal file
View File

@ -0,0 +1,56 @@
#!/bin/sh
IFCONF=/etc/network/ifattr
IFRESOLV=/etc/resolv.conf
NETDEV=/tmpfs/netdev
. $IFCONF
iface=`cat $NETDEV`
if [ ${dhcp} = "y" ];then
dhcpflag=on
elif [ ${dhcp} = "n" ];then
dhcpflag=off
fi
if [ ${dnstype} = "server" ] ; then
dnsstat=1
elif [ ${dnstype} = "specify" ] ; then
dnsstat=0
fi
DNS1=`grep nameserver $IFRESOLV | sed -n '1 s/^nameserver *//'p`
DNS2=`grep nameserver $IFRESOLV | sed -n '2 s/^nameserver *//'p`
MAC=`ip address show $iface|awk '/link\/ether/ {print $2}'`
ipinfo=`ifconfig $iface | grep "inet addr"`
##echo ipinfo is $ipinfo
#address=`echo $ipinfo | awk '{print $2}'| sed -n "s/addr://p"`
##echo $address
##address=`echo $ipinfo |sed -n "s/ /\n/gp"| grep -E 'addr'|sed -n "s/\addr://p"`
#netmask=`echo $ipinfo | awk '{print $4}'| sed -n "s/Mask://p"`
##netmask=`ifconfig $iface | grep 'inet addr'|sed -n "s/ /\n/gp"| grep -E 'Mask'|sed -n "s/\Mask://p"`
#gateway=`route | awk -v k="$iface" '{if ($1=="default" && $8==k) print $2}' `
#gateway=`route|grep $iface | awk '(/default/) {print $2}'`
#TODOLFF
if [ $iface = eth0 ];then
NETTYPE=LAN
else
NETTYPE=WIRELESS
fi
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "var dhcpflag = \"$dhcpflag\" ;\r"
echo -e "var ip = \"$address\" ;\r"
echo -e "var netmask = \"$netmask\" ;\r"
echo -e "var gateway = \"$gateway\" ;\r"
echo -e "var dnsstat = \"$dnsstat\" ;\r"
echo -e "var fdnsip = \"$DNS1\" ;\r"
echo -e "var sdnsip = \"$DNS2\" ;\r"
echo -e "var macaddress = \"$MAC\" ;\r"
echo -e "var networktype = \"$NETTYPE\" ;\r"

View File

@ -0,0 +1,15 @@
#! /bin/sh
if /sbin/ifconfig | grep eth0 > /dev/null
then
nettype="LAN"
else
nettype="WiFi"
fi
netmac=`grep macaddr /etc/ipcamera/config_priv.ini | awk '{print $3}'`
echo -e "Content-Type:text/plain\r"
echo -e "\r\n"
echo -e "var nettype = \"$nettype\" ;\r"
echo -e "var netmac = $netmac ;\r"

View File

@ -0,0 +1,5 @@
#!/bin/sh
CONF=/etc/ipcamera/upnp.conf
. $CONF
echo -e "\r"
echo -e "var upnpenable=$enable ;\r"

View File

@ -0,0 +1,75 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
IFS=";"
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
. $wifi_config
echo -e "Content-Type:text/plain\r"
echo -e "\r"
wifi_conf_path=/etc/network/wifi.conf
rt_wifiessid=`cat $wifi_conf_path | grep "wifiessid=" | tail -n -1 | awk -F '"' '{ print $2 }'`
rt_findkeytype=`cat $wifi_conf_path | grep "wifikeytype=" | tail -n -1 | awk -F '=' '{ print $2 }'`
rt_wifiwhichkey=`cat $wifi_conf_path | grep "wifiwhichkey=" | tail -n -1 | awk -F '=' '{ print $2 }'`
rt_wifikey=`cat $wifi_conf_path | grep "wifikey=" | tail -n -1 | awk -F '"' '{ print $2 }'`
rt_wifienable=`cat $wifi_conf_path | grep "wifienable=" | tail -n -1 | awk -F '"' '{ print $2 }'`
echo var wifissid = \"${rt_wifiessid}\"\;
echo var wifikeytype = \"${rt_findkeytype}\"\;
echo var wifiwhichkey = \"${rt_wifiwhichkey}\"\;
echo var wifikey=\"${rt_wifikey}\"\;
echo var wifienable=\"${rt_wifienable}\"\;
wifimac=`cat /sys/class/net/${wifidev}/address 2>/dev/null`
echo var wifimac=\"$wifimac\"\;
if [ "$1" == "nolinkstatus" ]
then
exit
fi
wifi_realenable=$(wifi_getenable)
echo var wifienable=\"${wifi_realenable}\"\;
linedstatus=$(net_getlinedstatus)
##有线
if [ $linedstatus = 1 ]
then
echo var linkstatus=\"0\"\;
echo var linkssid=\"\"\;
echo var wifimode=\"\"\;
else
wifistatus_file=/tmpfs/wifistatus.$$
wpa_cli -i $wifidev status >$wifistatus_file 2>/dev/null
. $wifistatus_file
###debug echo wpa_state $wpa_state
linkstatus=$wpa_state
if [ -z ${linkstatus} ]
then
echo var linkstatus=\"0\"\;
elif [ ${linkstatus} = COMPLETED ]
then
echo var linkstatus=\"1\"\;
else
echo var linkstatus=\"0\"\;
fi
echo var linkssid=\"$ssid\"\;
echo var wifimode=\"$(wifi_getmode)\"\;
#rm $wifistatus_file
fi
echo

View File

@ -0,0 +1,20 @@
#!/bin/sh
wifi_module_type_path=/etc/network/wifimoduletype.conf
if [ -e $wifi_module_type_path ]
then
wifi_module_type=`cat $wifi_module_type_path | grep wifi_module_type | cut -d= -f2`
else
lsusb | grep 7601 >/dev/null 2>&1
mt7601=$?
if [ ${mt7601} == "0" ]
then
wifi_module_type=7601
else
wifi_module_type=0
fi
fi
echo $wifi_module_type

View File

@ -0,0 +1,22 @@
#!/bin/sh
#get_wifi_module_path=/bin/vslocal/cgi-bin/getwifimoduletype.sh
#if [ -e $wifi_module_type ]
#then
# wifi_module_type=`$get_wifi_module_path`
#else
# wifi_module_type=7601
#fi
if [ ${wifi_module_type} == "7601" ]
then
lsusb | grep 7601 >/dev/null 2>&1
mt7601_online=$?
echo $mt7601_online
elif [ ${wifi_module_type} == "8189" ]
then
echo 0
else
echo 1
fi

View File

@ -0,0 +1,33 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
##20141128 please use wifi_getstatus func
. $wifi_config
linedstatus=$(net_getlinedstatus)
##echo XXXXXXXXXX $linedstatus
if [ $linedstatus = 1 ]
then
#echo var linkstatus=\"0\"\;
echo 0
else
linkstatus=$(wifi_getstatus)
if [ -z ${linkstatus} ]
then
#echo var linkstatus=\"0\"\;
echo 0
elif [ ${linkstatus} = COMPLETED ]
then
#echo var linkstatus=\"1\"\;
echo 1
else
#echo var linkstatus=\"0\"\;
echo 0
fi
fi

View File

View File

@ -0,0 +1,41 @@
IFCONF=/etc/network/ifattr
IFRESOLV=/etc/network/resolv.conf
RESOLV=/etc/resolv.conf
DHCPC=/bin/vs/dhcp.sh
. $IFCONF
ifconfig $iface down
ifconfig $iface hw ether $mac
ifconfig $iface up
if [ $dhcp = y ]
then
#*************run udhcpc************************************
/sbin/udhcpc -i $iface -b
elif [ $dhcp = n ]
then
#*****************stop udhcpc TODO:use pidfile**************
killall -9 udhcpc
#************TODO:set ip mask******************************
if [ -n "$address" -a -n "$netmask" ];then
/sbin/ifconfig $iface $address netmask $netmask
fi
#************set Gateway DNS******************************
if [ $priflag = 1 ]
then
if [ -n $gateway ]
then
echo "deleting routers"
while /sbin/route del default gw 0.0.0.0
do :
done
/sbin/route add default gw $gateway dev $iface
fi
if [ -e $RESOLV ];then
rm -f $RESOLV
fi
cp $IFRESOLV $RESOLV
fi
fi

View File

@ -0,0 +1,5 @@
##!/bin/sh
/bin/vs/cgi-bin/inetconfig.cgi
/bin/vs/cgi-bin/inetwificonfig.cgi
/bin/vs/cgi-bin/upnp_start.cgi
/bin/vs/cgi-bin/ddns_start.cgi

View File

@ -0,0 +1,37 @@
#!/bin/bash
ip=(${1//[![:digit:]]/ })
mask=(${2//[![:digit:]]/ })
for i in ${mask[*]}
do
j=7
tag=1
while [ $j -ge 0 ]
do
k=$((2**$j))
if [ $(( $i & $k )) -eq $k ]; then
if [ $tag -eq 1 ]; then
(( n += 1 ))
else
echo -e "\n$2 is a bad netamsk with holes\n"
exit
fi
else
tag=0
fi
(( j -= 1 ))
done
done
for i in 0 1 2 3
do
a=$a${a:+.}$((${ip[i]} & ${mask[i]}))
b=$b${b:+.}$((${ip[i]} | (${mask[i]} ^ 255)))
done
echo
echo Network number: $a
echo Broadcast address: $b
echo Netmask bits: $n

View File

@ -0,0 +1,21 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
#cp /nfsroot/rootfs/bin/vs/cgi-bin/ipconfig.sh /bin/vslocal/cgi-bin/
#连接或者断开
###全局变量
# $1 AP|STA|LINED
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
show_info "call ipconfig.sh"
net_setip $1

View File

@ -0,0 +1,59 @@
#!/bin/sh
#偶尔会出问题, 先暂时屏蔽掉
# echo 200 OK HTTP 1.1
# echo
# echo var p2p_enable = "-1";
# echo -e "\r\n"
#
# exit
# '## /bin/vs/cgi-bin/p2p.cgi "&-action=get"'
# '##/bin/vs/cgi-bin/p2p.cgi "&-action=set&-enable=0"'
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
URL="`get_param "url"`"
#echo $URL > /tmpfs/URL.tmp
ping -c 5 -q $URL > /tmpfs/iptest.tmp
if [ $? = 0 ]
then
LOSS=`cat /tmpfs/iptest.tmp | grep loss | awk -F ',' '{print $3}' | awk -F '%' '{print $1}'`
else
LOSS=100
fi
#LOSS=`ping -c 5 -q $URL | grep loss | awk -F ',' '{print $3}' | awk -F '%' '{print $1}'`
echo 200 OK HTTP 1.1
echo
echo var loss=\"${LOSS}\"\;
echo -e "\r\n"
#echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"

View File

@ -0,0 +1,20 @@
#!/bin/sh
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
if [ -e $wifiscanresult ]
then
cat $wifiscanresult | sed "1d;$d" | awk 'BEGIN {print "Content-Type:text/plain\n\r\n\r"}{print "var ssid_"NR "=\""$5"\";\n\r" "var signal_"NR "=\""$3"\";\n\r" "var secret_"NR "=\""$4"\";\n\r"}'
else
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "NONE""\r"
fi
echo -e "\r"
#iwlist $iface scan |awk -F: 'BEGIN {print "200 OK HTTP 1.1\n\n"} /Channel:|ESSID:|Encryption key:/ {print "var "$1"="$2";"}'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,631 @@
#!/bin/sh
###nolined means unplug line
##ACTION = NONE, PlugLine, UnplugLine, TO_STA, TO_WPS, TO_AP
##WIFISTATE = NONE, (STA_CONNECTING, STA_FAILED), STA_OK, (WPS_CONNECTTING, WPS_FAILED, WPS_OK)
##LINESTATE = LINED, NOLINED
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
. /bin/vs/cgi-bin/wifiled.sh
. /bin/vs/cgi-bin/ap_ssid.sh
var_wifi_connecting_times=0
var_wificonnect_cnt=0
var_wifi_fastlink_connecting_times=0
var_wifi_playconnectfailure=0;
var_wifi_disconnet=0
####如果WIFI器件不存在退出脚本如果后期WIFI器件存在需要在程序中重新拉起脚本
if [ $wifi_module_type == "0" ]
then
echo "wifi_off" > /proc/rt/led
exit
fi
wifi_connecting_cnt_reset()
{
var_wifi_connecting_times=0
var_wificonnect_cnt=0
}
net_doaction()
{
#netaction=$net_action_curr
netaction=$(net_getaction)
#show_dbg2 "net_doaction $netaction "
case $netaction in
NONE)
zzz=1
;;
PLUGLINE)
wifi_ledflash 5 #add by liutao for 288192a
show_info "process netaction plug line"
wifi_modeswitch "LINED"
net_setdev eth0
#ifconfig $wifidev 0.0.0.0
net_off $wifidev
net_setaction NONE
net_setip LINED
wifi_ledflash 0
;;
UNPLUGLINE)
### 判断是否wifi使能, 如果使能, 开始切换动作到 TO_STA
### 否则, 什么都不做
show_info "process netaction unplug line"
wifienable=$(wifi_getenable)
show_info "wifienable:$wifienable"
##1 / 2
if [ $wifienable == 1 -o $wifienable == 2 ]
then
show_info "unplug line, wifienable is $wifienable. will start wifi"
#ifconfig eth0 0.0.0.0
net_off eth0
net_setdev $wifidev
#customernum=`paraconf r 2 customernum`
show_info "customernum------>"$customernum
. $wifi_config
############SBTC SSID="TEST-WIFI" GO TO SMTCN
if [ ! -z $customernum ] && [ $customernum == "55" ] && [ $wifiessid == "TEST-WIFI" ] && [ $cfg_wifiautosmtcn == "1" ];then
while [ 1 ]
do
if [ -f /tmpfs/vs_server.pid ];then
break;
fi
show_info "--------------------->sbtc wait vs_server"
sleep 1
done
net_setaction TO_SMTCN
elif [ ! -z $customernum ] && [ $wifiessid == "TEST-WIFI" ] && [ $cfg_wifiautoap == "2" ];then
show_info "--------------------->rentu_to_ap"
net_setaction TO_AP
elif [ $wifiessid == "544553542D57494649" ] && [ $cfg_wifiautoap == "0" ];then
show_info "--------------------->quick_to_ap"
net_setaction TO_AP
else
boardtype=`cat /etc/board.conf | grep boardtype= | cut -d = -f 2`
if [ $customernum == "49" ] && [ $boardtype == "3500" ];then
net_setaction TO_AP
else
net_setaction TO_STA
fi
fi
else
if [ -e /tmpfs/pppd/pppd_connect.status ];then ###3G板子识别到sim,会产生此文件,并且设备3G设备使用的是3G网络,否则不会走此分支
p2p_tran=`paraconf r 1 P2P_TRAN`
echo "ppp0" > /tmpfs/netdev ###将当前的网络状态写ppp0
killall $p2p_tran ###因为glink程序需要写入当前正使用的设备的网络状态信息方能ok,安全起见把其他tran程序也kill
show_info "curr dev ppp0"
fi
show_info "unplug line, but wifienable is $wifienable. donothing"
net_setaction NONE
fi
wifi_ledflash 4
;;
TO_STA)
wifi_ledflash 4
show_dbg2 "process netaction TO_STA"
var_wifi_connecting_times=0
var_wificonnect_cnt=0
wifi_modeswitch "STA"
net_setaction NONE
if [ ! -z $customernum ] && [ $customernum == "96" ];then
wifi_audio_connecting
fi
;;
TO_WPS)
show_dbg2 "process netaction TO_WPS"
wifi_modeswitch "WPS"
net_setaction NONE
wifi_ledflash 3
;;
TO_AP)
show_dbg2 "process netaction TO_AP"
## APFile="/etc/Wireless/RT2870AP/RT2870AP.orig.dat"
#wifi_module_type=`/bin/vslocal/cgi-bin/getwifimoduletype.sh`
if [ $wifi_module_type == "7601" ]
then
if [ ! -e /etc/Wireless/RT2870AP/RT2870AP.orig.dat ]
then
show_error "$wifi_module_type Can't Enter AP mode. Not exist ap config "
net_setaction "NONE"
wifi_setstate NONE
else
###wifi_audio_to_ap ###提示声距进入ap的时差太久,故不放在这里提示放在start_to_ap处提示
wifi_setstate "AP"
wifi_modeswitch "AP"
net_setaction NONE
fi
elif [ $wifi_module_type == "8189" ]
then
wifi_setstate "AP"
wifi_modeswitch "AP"
net_setaction NONE
else
show_error "Can't Enter AP mode. unknown wifi_module: $wifi_module_type "
net_setaction "NONE"
wifi_setstate NONE
fi
;;
TO_SMTCN)
show_dbg2 "process netaction TO_SMTCN"
wifi_modeswitch "SMTCN"
net_setaction NONE
wifi_ledflash 4
;;
TO_FATCN)
show_dbg2 "process netaction TO_FATCN"
wifi_modeswitch "FATCN"
net_setaction NONE
wifi_ledflash 4
;;
TO_FIXNET)
show_dbg2 "process netaction TO_FIXNET"
wifi_modeswitch "FIXNET"
net_setaction NONE
wifi_ledflash 4
;;
TO_TEST)
;;
*)
echo "unknown action $netaction"
net_setaction NONE
;;
esac
}
wifi_flags=0
wifi_dostate()
{
prewifistate=$1
curwifistate=$2
#show_dbg2 "wifi_dostate $prewifistate , $curwifistate"
case $curwifistate in
NONE)
;;
STA_CONNECTING)
show_dbg2 "STA_CONNECTING var_wifi_connecting_times $var_wifi_connecting_times var_wificonnect_cnt $var_wificonnect_cnt"
if [ $var_wifi_connecting_times -eq 0 ] && [ $var_wificonnect_cnt -eq 0 ]
then
sleep 2 #RT_LLQ,当从正在连接的STA切到错误的STA时需要延时等状态改变
fi
if [ $var_wifi_connecting_times -eq 0 ]
then
###camsense使用
if [ ! -z $customernum ] && [ $customernum == "123" ];then
is_found=`cat /etc/network/wifista.conf`
show_dbg2 "=== is_found_wifi=$is_found"
if [ ${is_found}"A" = "NOTFOUNDA" ]
then
wifi_setstate STA_FAILED
return
fi
fi
if [ $var_wificonnect_cnt -lt $cfg_wifi_retry ]
then
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate STA_OK
return
fi
var_wificonnect_cnt=`expr $var_wificonnect_cnt + 1`
show_info "Linkstatus is $linkstatus"
else
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate STA_OK
else
wifi_setstate STA_FAILED
fi
return
fi
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
else
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
if [ $var_wifi_connecting_times -ge $cfg_wifi_retry_internal ]
then
var_wifi_connecting_times=0
fi
fi
;;
STA_FAILED)
wifi_connecting_cnt_reset
if [ $cfg_wifiautoap = 1 ]
then
show_info1 "STA connect failed. AUTO to AP"
net_setaction TO_AP
elif [ $cfg_wifiautoap = 2 ] #人图 ap_auto=2
then
show_info1 "STA connect failed. AUTO to AP"
net_setaction TO_AP
elif [ $cfg_wifiautofixnet = 1 ]
then
show_info1 "STA connect failed. AUTO to FIXNET"
net_setaction TO_FIXNET
else
if [ $cfg_stafailedafter = "AP" ]
then
net_setaction TO_AP
else
net_setaction TO_STA
fi
fi
wifi_setstate NONE
wifi_ledflash 4
;;
STA_OK)
wifi_connecting_cnt_reset
show_dbg2 "STA OK"
#wifi_setstate NONE
net_setip STA
wifi_ledflash 1
wifi_audio_connectsuccess
var_wifi_disconnet=0
wifi_setstate STA_CHECK
;;
STA_CHECK)
sleep 2
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
if [ $var_wifi_disconnet -eq 1 ]
then
var_wifi_disconnet=0
wifi_ledflash 1
fi
else
if [ $var_wifi_disconnet -eq 0 ]
then
show_dbg2 "STA CONNECTING BREAK!"
var_wifi_disconnet=1
if [ -e /bin/vs/cgi-bin/wifi_off_on.sh ];then
/bin/vs/cgi-bin/wifi_off_on.sh &
fi
#wifi_setstate NONE
wifi_ledflash 4
fi
fi
;;
WPS_CONNECTING)
show_dbg2 "STA_CONNECTING var_wifi_connecting_times $var_wifi_connecting_times var_wificonnect_cnt $var_wificonnect_cnt"
if [ $var_wifi_connecting_times -eq 0 ]
then
if [ $var_wificonnect_cnt -lt $cfg_wifiwps_retry ]
then
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate WPS_OK
return
fi
var_wificonnect_cnt=`expr $var_wificonnect_cnt + 1`
show_info "Linkstatus is $linkstatus"
else
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate WPS_OK
else
wifi_setstate WPS_FAILED
fi
return
fi
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
else
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
if [ $var_wifi_connecting_times -ge $cfg_wifiwps_retry_internal ]
then
var_wifi_connecting_times=0
fi
fi
;;
WPS_FAILED)
show_info "WPS_FAILED"
wifi_connecting_cnt_reset
###spotcam 2592版本WPS失败进入AP
if [ $customernum == "92" ] && [ $boardtype == "2500" ];then
wifi_setstate "AP"
wifi_modeswitch "AP"
net_setaction NONE
else
wifi_setmode STA
##reread wpa_conf.conf file
wpa_cli -i $wifidev reconfig
wifi_setstate NONE
net_setaction TO_STA
fi
wifi_ledflash 3
;;
WPS_OK)
show_info "WPS_OK"
wifi_connecting_cnt_reset
wifi_wpsOK
wifi_setmode STA
wifi_setstate NONE
wifi_ledflash 1
;;
AP)
wifi_connecting_cnt_reset
wifi_ledflash 2
wifi_setstate NONE
;;
SMTCN_CONNECTING)
show_info "SMTCN_CONNECTING"
smtcn_node=`get_smtcn_node`
if [ -e $smtcn_node ];then
SMTCN_SSID=`cat $smtcn_node | awk -F ", " '{printf $2}' | awk -F "=" '{printf $2}'`
if [ "${SMTCN_SSID}""A" != "A" ];then
wifi_setstate SMTCN_OK
else
echo "start" > $smtcn_node
fi
fi
if [ -e /tmpfs/voice_wifi ];then
SMTCN_SSID=`cat /tmpfs/voice_wifi | grep SSID | awk -F ": " '{printf $2}'`
if [ "${SMTCN_SSID}""A" != "A" ];then
wifi_setstate VOICE_OK
fi
fi
;;
SMTCN_OK)
var_wifi_playconnectfailure="1"
show_info "SMTCN_OK"
wifi_smtcnOK
if [ $? != "0" ];then
wifi_setstate STA_FAILED
wifi_setmode STA
else
close_voice_cfg_wifi_mode.sh ####当声波配置和smartlink共存时,此时去用smartlink去配置wifi会没有声音,故这里先关闭声波配置,不影响smartlink
sleep 1
net_setaction TO_STA
wifi_setmode STA
wifi_setstate NONE
wifi_ledflash 1
wifi_audio_connecting
fi
;;
VOICE_OK)
var_wifi_playconnectfailure="1"
show_info "VOICE_OK"
wifi_smtcn_stop
wifi_voiceOK
if [ $? != "0" ];then
wifi_setstate STA_FAILED
wifi_setmode STA
else
net_setaction TO_STA
wifi_setmode STA
wifi_setstate NONE
wifi_ledflash 1
wifi_audio_connecting
fi
;;
FATCN_CONNECTING)
show_info "FATCN_CONNECTING"
var_wifi_fastlink_connecting_times=`expr $var_wifi_fastlink_connecting_times + 1`
if [ $var_wifi_fastlink_connecting_times -gt $cfg_wififastlink_retry_internal ];then
var_wifi_fastlink_connecting_times=0
killall fastlink
/bin/vslocal/cgi-bin/fastlink &
fi
if [ -e /tmpfs/fastlink.conf ];then
FATCN_SSID=`cat /tmpfs/fastlink.conf | grep SSID | awk -F ": " '{printf $2}'`
if [ ! -z $FATCN_SSID ];then
wifi_setstate FATCN_OK
killall fastlink
fi
fi
;;
FATCN_OK)
var_wifi_playconnectfailure="1"
show_info "FATCN_OK"
wifi_fatcnOK
net_setaction TO_STA
wifi_setmode STA
wifi_setstate NONE
wifi_ledflash 1
wifi_audio_connecting
;;
FIXNET_CONNECTING)
show_dbg2 "FIXNET_CONNECTING var_wifi_connecting_times $var_wifi_connecting_times var_wificonnect_cnt $var_wificonnect_cnt"
if [ $var_wifi_connecting_times -eq 0 ]
then
if [ $var_wificonnect_cnt -lt $cfg_wifi_retry ]
then
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate FIXNET_OK
return
fi
var_wificonnect_cnt=`expr $var_wificonnect_cnt + 1`
show_info "Linkstatus is $linkstatus"
else
linkstatus=$(wifi_getstatus)
if [ ${linkstatus}"A" = COMPLETED"A" ]
then
wifi_setstate FIXNET_OK
else
show_info1 "FIXNET_FAILED"
wifi_connecting_cnt_reset
net_setaction TO_FIXNET
#wifi_setstate FIXNET_FAILED
fi
#return
fi
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
else
var_wifi_connecting_times=`expr $var_wifi_connecting_times + 1`
if [ $var_wifi_connecting_times -ge $cfg_wifi_retry_internal ]
then
var_wifi_connecting_times=0
fi
fi
;;
FIXNET_OK)
wifi_connecting_cnt_reset
show_dbg2 "FIXNET OK"
wifi_fixnetOK
wifi_setstate NONE
wifi_setmode STA
net_setip STA
wifi_ledflash 1
wifi_audio_connectsuccess
;;
*)
;;
esac
}
#if [ -e /tmpfs/net_serv.pid ]
#then
# kill -9 `cat /tmpfs/net_serv.pid`
# rm /tmpfs/net_serv.pid -f
#fi
echo $$ > /tmpfs/net_serv.pid
show_info "start net_serv daemon $$"
if [ -e $ip_config ]
then
. $ip_config
##不存在ip地址
if [ -z $address ]
then
net_gen_ifattr
fi
else
net_gen_ifattr
fi
wifistate_prev=NONE
linestate_prev=NONE
mkdir -p /tmpfs/net/
mkdir /var/run/wpa_supplicant -p
mkdir -p /var/run/hostapd
net_setaction "NONE"
#net_setmac
wifi_realenable=$(wifi_getenable)
show_info "wifi_realenable is $wifi_realenable"
preload_wifiko=0
var_wifiko_check_cnt=0
cur_network_mode="NONE"
##gen_last_wpa_config
while [ 1 ]
do
#获取有线状态
linestate_curr=$(net_getlinedstatus)
##show_dbg "linestate_curr is $linestate_curr and $linestate_prev"
## 网线插拔状态有变化
if [ $linestate_curr != $linestate_prev ]
then
show_dbg "linestate_change $linestate_prev TO $linestate_curr."
linestatechanged=1
if [ $linestate_curr = 0 -o $linestate_curr = 2 ]
then
net_setaction "UNPLUGLINE"
elif [ $linestate_curr = 1 ]
then
net_setaction "PLUGLINE"
fi
fi
net_doaction
linestate_prev=$linestate_curr
###curnetaction=$(getnetaction)
#echo $wifistate_prev , $wifistate_curr
wifi_dostate $wifistate_prev $wifistate_curr
wifistate_prev=$wifistate_curr
if [ $preload_wifiko = 1 ]
then
if [ $wifi_realenable -ge 1 ]
then
preload_wifiko=0
wifi_sta_start
echo "wifimac=`cat /sys/class/net/${wifidev}/address`" > $mac_wifi_file
else
echo "wifimac=" > $mac_wifi_file
fi
preload_wifiko=0
fi
#wifi_module_type=`/bin/vslocal/cgi-bin/getwifimoduletype.sh`
#####如果是有线模式且WIFI驱动被加载了则等待2分钟后卸载驱动
cur_network_mode=`wifi_getmode`
if [ ${cur_network_mode} == "NONE" ]
then
if [ $wifi_module_type == "7601" ]
then
ret=`lsmod | grep 7601 > /dev/null ;echo $?`
elif [ $wifi_module_type == "8189" ]
then
ret=`lsmod | grep 8189 > /dev/null ;echo $?`
else
ret=1
fi
if [ ${ret} == 0 ];then
var_wifiko_check_cnt=`expr $var_wifiko_check_cnt + 1`
echo "var_wifiko_check_cnt:"${var_wifiko_check_cnt}
fi
if [ ${var_wifiko_check_cnt} -gt 60 ]
then
wifi_sta_stop
var_wifiko_check_cnt=0
fi
else
var_wifiko_check_cnt=0
fi
sleep 1
###ledflash
done

View File

@ -0,0 +1,666 @@
#!/bin/sh
export PATH=$PATH:/wifi:/bin/vs/cgi-bin:/bin/vs
wifi_check_path=/etc/ipcamera/network/wifi_disconnect_status
config_path=/etc/network
tmpfs_path=/tmpfs
wifidev_config=$config_path/wifidev.conf
wifi_config=$config_path/wifi.conf
wifi_config_tmp=$tmpfs_path/wifi.conf
wifi_config_test=$tmpfs_path/wifi_test.conf
if [ -e $wifi_config_test ];then
wifi_config=$wifi_config_test
fi
ip_config=$config_path/ifattr
ip_config_bak=$tmpfs_path/ifattr
##wpa_config=$tmpfs_path/wpa_supp.conf
wpa_config=$config_path/wpa_supp.conf
wpa_config_tmp=$tmpfs_path/wpa_supp.conf
wpa_driver=nl80211
fixnet_config=$config_path/fixnet.conf
wifimode=$tmpfs_path/wifimode
wifiscanresult=$tmpfs_path/wifiaplist
net_action_file=/tmpfs/net/net_action
wifi_state_file=/tmpfs/net/wifi_state
ip_cache1=$tmpfs_path/net/ip_cache1
ip_cache2=$tmpfs_path/net/ip_cache2
mac_lined_file=$tmpfs_path/net/mac.lined
mac_wifi_file=$tmpfs_path/net/mac.wifi
ap_cfgfile="/etc/network/wifiap.conf"
ap_ip=192.168.234.1
ap_mask=255.255.255.0
ap_gateway=192.168.234.1
######在下面这个文件中定制ap_ip ap_mask ap_gateway
if [ -e /etc/wifiap_ifattr ];then
. /etc/wifiap_ifattr
fi
IFCONF=$config_path/ifattr
IFRESOLV=/etc/resolv.conf
NETDEV=$tmpfs_path/netdev
####TODO maybe get from configfile
export cfg_wifi_retry=4
### 每次重试的间隔时间
export cfg_wifi_retry_internal=6
#export cfg_wifi_retry_internal=2
####TODO maybe get from configfile
export cfg_wifiwps_retry=12
### 每次重试的间隔时间
export cfg_wifiwps_retry_internal=10
### fastlink多久没有接收到数据
export cfg_wififastlink_retry_internal=30
networkmedia=$config_path/networkmedia.conf
default_net_priflag=1
#iface=
default_net_dhcp=n
default_net_dnstype=specify
default_net_address=192.168.0.136
default_net_netmask=255.255.255.0
default_net_gateway=192.168.0.1
. $wifidev_config
export wifidev
export currdev=eth0
#echo wifidev $wifidev
export wifistate_curr=NONE
export net_action_curr=NONE
export wifimode_curr=NONE
export cfg_wifiautosmtcn=0
export cfg_wifiautofatcn=0
export cfg_stafailedafter=NONE
if [ -e $ap_cfgfile ]
then
. $ap_cfgfile
if [ -z $ap_auto ]
then
export cfg_wifiautoap=1
else
export cfg_wifiautoap=$ap_auto
fi
if [ ! -z $smtcn_auto ]
then
export cfg_wifiautosmtcn=$smtcn_auto
fi
if [ ! -z $fatcn_auto ]
then
export cfg_wifiautofatcn=$fatcn_auto
fi
if [ ! -z $fixnet_auto ]
then
export cfg_wifiautofixnet=$fixnet_auto
fi
if [ ! -z $sta_failed_after ]
then
export cfg_stafailedafter=$sta_failed_after
fi
else
export cfg_wifiautoap=0
fi
#customernum1=`cat /etc/ipcamera/config_devm.ini | grep ^customernum= | sed '2,$d' | cut -d = -f2`
#if [ -z $customernum1 ];then
# customernum1="00"
#fi
export customernum=`paraconf r 2 customernum`
#获取wifi类型
get_wifi_module_type_path="/bin/vslocal/cgi-bin/getwifimoduletype.sh"
if [ -e $get_wifi_module_type_path ]
then
wifi_module_type_tmp=`$get_wifi_module_type_path`
export wifi_module_type=$wifi_module_type_tmp
else
export wifi_module_type=7601
fi
##smtcn_node=/proc/smart_connection
smtcn_node=/proc/elian
get_smtcn_node()
{
if [ -e /proc/elian ];then
echo "/proc/elian"
else
echo "/proc/smart_connection"
fi
}
show_info()
{
echo -e "\033[32m $1 \033[0m" >&2
}
show_info1()
{
echo -e "\033[35m $1 \033[0m" >&2
}
show_error()
{
echo -e "\033[41;37m $1 \033[0m" >&2
}
show_dbg()
{
echo -e "\033[35m debug $* \033[0m" >&2
}
show_dbg2()
{
echo -e "\033[36m debug2 $* \033[0m" >&2
}
show_func()
{
echo -e "\033[35m func $* \033[0m" >&2
}
str_lastn()
{
str=$1
n=$2
strlen=${#str}
if [ ${strlen} -le ${n} ]
then
sn=${str}
else
let start=strlen-n
sn=${str:$start:$n}
fi
echo $sn
}
str_frontn()
{
str=$1
n=$2
strlen=${#str}
if [ ${strlen} -le ${n} ]
then
sn=${str}
else
let start=0
sn=${str:$start:$n}
fi
echo $sn
}
net_off()
{
show_dbg "net_off $1"
ifconfig $1 0.0.0.0
ifconfig $1:1 0.0.0.0 2>/dev/null
}
net_up()
{
show_dbg "net_up $1"
ifconfig $1 up
#ifconfig $1:1 0.0.0.0 2>/dev/null
}
net_down()
{
show_dbg "net_down $1"
net_off $1
ifconfig $1 down
}
## 获取指定网卡网络状态, 输入$1 为网卡, 返回状态,
## 0 不存在, 1 在线, 2, 只有无线
net_getstatus()
{
v=`cat /sys/class/net/$1/carrier 2>$tmpfs_path/err`
status=1
# iface down
if [ -z $v ]
then
status=2
else
status=$v
fi
echo $status
}
## 获取有线状态
net_getlinedstatus()
{
linedstatus=0
networkmedia_lined=YES
if [ -e $networkmedia ]
then
. $networkmedia
if [ -z $networkmedia_lined ]
then
networkmedia_lined=YES
fi
#echo "DDD netype lined is $networkmedia_lined"
else
networkmedia_lined=YES
fi
if [ $networkmedia_lined = "NO" ]
then
linedstatus=2
else
linedstatus=$(net_getstatus eth0)
fi
echo $linedstatus
}
#NONE
#STA
#AP
#WPS
wifi_setmode()
{
show_info "wifi setmode to $1"
wifimode_curr=$1
echo $wifimode_curr > $wifimode
}
wifi_getmode()
{
wifim="NONE"
if [ -e $wifimode ]
then
wifim=`cat $wifimode`
fi
echo $wifim
}
wifi_getenable()
{
wifienable=0
ifconfig $wifidev >$tmpfs_path/ra0status 2>&1
ra0status=$?
if [ $ra0status = 1 ]
then
echo -1
return 0
fi
if [ -e $wifi_config ]
then
##get wifienable from config file
. $wifi_config
else
wifienable=-1
fi
echo $wifienable
}
net_gen_ifattr()
{
show_info "Not exist ifattr var."
priflag=$default_net_priflag
dhcp=$default_net_dhcp
dnstype=$default_net_dnstype
address=$default_net_address
netmask=$default_net_netmask
gateway=$default_net_gateway
echo -e "##autogen\n" \
"priflag=$priflag\n"\
"dhcp=$dhcp\n"\
"dnstype=$dnstype\n"\
"address=$address\n"\
"netmask=$netmask\n"\
"gateway=$gateway\n"> $ip_config
sync
}
net_setmac()
{
show_info "[ipconfig]Set MAC"
linediface=eth0
mac=`paraconf r 1 mac`
ret=$?
if [ -z ${mac} ] && [ -f /tmpfs/paraconf ]
then
mac=`cat /tmpfs/paraconf | grep mac | cut -d= -f2`
fi
if [ "${mac}A" = "A" ] || [ "${mac}" = "null" ]
then
. /etc/board.conf
mac=`randommac $boardtype`
show_info "auto gen MAC:$mac"
#ifconfig $linediface down
ifconfig $linediface hw ether $mac
#ifconfig $linediface up
paraconf w 1 mac $mac
echo "$mac" >> /etc/ipcamera/mac.lst
else
show_info "set MAC $mac"
#ifconfig $linediface down
net_down $linediface
ifconfig $linediface hw ether $mac
#ifconfig $linediface up
net_up $linediface
fi
echo "macaddress=$mac" > $mac_lined_file
sync
}
#设置当前使用的网卡
net_setdev()
{
if [ -z $1 ]
then
echo eth0 > $tmpfs_path/netdev
else
echo $1 > $tmpfs_path/netdev
fi
sync
}
net_getdev()
{
if [ -e $tmpfs_path/netdev ]
then
netdev=`cat $tmpfs_path/netdev`
else
netdev=eth0
fi
echo $netdev
}
net_setaction()
{
l_act=NONE
if [ ! -z $1 ]
then
l_act=$1
fi
show_dbg "Net Action Change $l_act"
net_action_curr=$l_act
echo "action=$l_act" > $net_action_file
}
net_getaction()
{
l_act=NONE
if [ -e $net_action_file ]
then
. $net_action_file
if [ -z action ]
then
l_act=NONE
else
l_act=$action
fi
fi
echo $l_act
}
wifi_setstate()
{
l_state=NONE
if [ ! -z $1 ]
then
l_state=$1
fi
wifistate_curr=$l_state
show_dbg "wifi state Change $wifistate_curr"
echo $wifistate_curr > $wifi_state_file
}
wifi_getstate()
{
echo $wifistate_curr
}
net_cache()
{
#$1 NETTYPE #$2 IP #$3 MASK #$4 GW #$5 MAC #$6 DHCPFlag #$7 DNSFlag $8IP2
if [ $6 = 0 ]
then
dhcpflag="off"
#dnsflag="0"
else
dhcpflag="on"
#dnsflag="1"
fi
if [ -z $7 ]
then
##show_info "not para 7"
. $ip_config
else
dnstype=$7
fi
if [ $dnstype = "server" ]
then
dnsflag=1
else
dnsflag=0
fi
show_info "dnstype:$dnstype, dnsflag:$dnsflag"
if [ $1 = "ra0" ]
then
nettype="WIRELESS"
else
nettype="LAN"
fi
echo -e -n "var networktype = \"$nettype\" ;\r\n"\
"var ip = \"$2\" ;\r\n"\
"var netmask = \"$3\" ;\r\n"\
"var gateway = \"$4\" ;\r\n"\
"var macaddress = \"$5\" ;\r\n"\
"var dhcpflag = \"$dhcpflag\" ;\r\n"\
"var dnsstat = \"$dnsflag\" ;\r\n" \
"var ip2 = \"$onvif_plugplay_ip\" ;\r\n" > $ip_cache1
echo -e -n "networktype $1 \n"\
"ip $2 \n"\
"netmask $3 \n"\
"gateway $4 \n"\
"macaddress $5 \n"\
"dhcpflag $6 \n"\
"dnsstat $dnsflag \n" \
"ip2 $onvif_plugplay_ip \n" > $ip_cache2
sync
show_info "net change, cache it.nettype $1 ip $2 dhcp $6 ip2 $onvif_plugplay_ip"
logger "gen ip cache nettype $1 ip $2 dhcp $6 ip2 $onvif_plugplay_ip"
}
#icatchplugplay=`cat /etc/ipcamera/onvif.ini | grep ^icatchplugplay= | sed '2,$d' | cut -d = -f2`
#if [ -z $icatchplugplay ];then
# icatchplugplay="0"
#fi
icatchplugplay=0;
net_ipconfig()
{
##$1 netcard
##$2 dhcp
##$3 ip(address)
##$4 netmask
##$5 gateway
##$6 dnsflag
iface=$1
dhcp=$2
address=$3
netmask=$4
gateway=$5
dnsflag=$6
. $mac_lined_file
if [ $icatchplugplay == "1" ]
then
show_info "icahtchplugplay enable"
export onvif_plugplay_ip=`mactoip $macaddress`
if [ $? == "0" ]
then
show_info "onvif_plugplay_ip is $onvif_plugplay_ip ,mac $macaddress"
ifconfig $iface:1 $onvif_plugplay_ip netmask 255.0.0.0
else
show_error "excute mactoip $macaddress error"
fi
fi
show_info "iface:$iface,dhcp:$dhcp,ip:$address,netmask:$netmask,gateway:$gateway:dnsflag:$dnsflag"
if [ $dhcp = y ]
then
#*************run udhcpc************************************
killall -9 udhcpc 2>/dev/null
/sbin/udhcpc -i $iface -b -A 3
elif [ $dhcp = n ]
then
#*****************stop udhcpc TODO:use pidfile**************
killall -9 udhcpc 2>/dev/null
#***************** Flush route table, if use 2 iface, thie ???? *****
###By BT 20140827 ip route show | awk -v k="$iface" '$0 !~ k { print " ip route delete " $0 | "sh" }'
ip route show | awk -v k="$iface" '$0 !~ k && $0 !~ "lo" { print " ip route delete " $0 | "sh" }'
#************TODO:set ip mask******************************
#if not lined network , clear ip
if [ -n "$address" -a -n "$netmask" ];then
/sbin/ifconfig $iface $address netmask $netmask
fi
#************set Gateway DNS******************************
route add default gw $gateway dev $iface 2>/dev/null
route add -net 239.0.0.0 netmask 255.0.0.0 $iface 2>/dev/null
. $mac_lined_file
#$1 NETTYPE #$2 IP #$3 MASK #$4 GW #$5 MAC #$6 DHCPFlag #$7 DNSFlag
if [ $icatchplugplay == "1" ]
then
show_info "icahtchplugplay enable"
export onvif_plugplay_ip=`mactoip $macaddress`
if [ $? == "0" ]
then
show_info "onvif_plugplay_ip is $onvif_plugplay_ip ,mac $macaddress"
ifconfig $iface:1 $onvif_plugplay_ip netmask 255.0.0.0
else
show_error "excute mactoip $macaddress error"
fi
fi
net_cache $iface $address $netmask $gateway $macaddress "0" $dnsflag
#echo -e -n "var ip = \"$address\" ;\r\n"\
# "var netmask = \"$netmask\" ;\r\n"\
# "var gateway = \"$gateway\" ;\r\n"\
# "var macaddress = \"$macaddress\" ;\r\n" > $ip_cache1
#sync
/bin/vs/mcast.sh 5 &
fi
arping -c 3 -b -I $iface 192.168.0.1 &
}
net_setip()
{
. $ip_config
#生成默认ifattr
if [ -z $dnstype ]
then
net_gen_ifattr
. $ip_config
fi
nettype=$1
case $nettype in
LINED)
iface=eth0
#ifconfig $wifidev 0.0.0.0 2>/dev/null
net_off $wifidev
net_ipconfig $iface $dhcp $address $netmask $gateway $dnstype
;;
STA)
iface=ra0
#ifconfig eth0 0.0.0.0
net_off eth0
net_ipconfig $iface $dhcp $address $netmask $gateway $dnstype
;;
AP)
iface=ra0
#ifconfig eth0 0.0.0.0
net_off eth0
wifi_ap_ipcfg
;;
*)
;;
esac
}
net_setip_currdev()
{
. $ip_config
iface=$(net_getdev)
show_info "currdev is $iface, dhcp:$dhcp, dnstype:$dnstype"
net_ipconfig $iface $dhcp $address $netmask $gateway $dnstype
}
#$1 as NONE,devsrejoin reboot, WIFI_STA
sys_setaction()
{
if [ -z $1 ]
then
echo "NONE" > /tmpfs/sysmon
else
echo "$1" > /tmpfs/sysmon
fi
fsync /tmpfs/sysmon
}

View File

@ -0,0 +1,139 @@
#!/bin/sh
wifi_audio_connectsuccess()
{
return
CustomNum=`cat /mnt/config/ipcamera/config_devm.ini | grep customernum= -m1 | cut -d = -f 2 `
if [ ! -z $CustomNum ] && [ $CustomNum == "47" ] || [ $CustomNum == "123" ];
then
return ;
fi
if [ ! -e /bin/vs/media/connectsuccess.g711a ]
then
show_error "Have no connectsuccess audio"
return
else
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/playaudio.cgi?&-playstate=1&-playfile=connectsuccess"
fi
}
wifi_audio_connectfailure()
{
return
CustomNum=`cat /mnt/config/ipcamera/config_devm.ini | grep customernum= -m1 | cut -d = -f 2 `
if [ ! -z $CustomNum ] && [ $CustomNum == "56" ] || [ $CustomNum == "47" ] || [ $CustomNum == "123" ];
then
return ;
fi
if [ ! -e /bin/vs/media/connectfailure.g711a ]
then
show_error "Have no connectfailure audio"
return
else
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/playaudio.cgi?&-playstate=1&-playfile=connectfailure"
fi
}
wifi_audio_connecting()
{
return
CustomNum=`cat /mnt/config/ipcamera/config_devm.ini | grep customernum= -m1 | cut -d = -f 2 `
if [ ! -z $CustomNum ] && [ $CustomNum == "56" ] || [ $CustomNum == "47" ] || [ $CustomNum == "123" ];
then
return ;
fi
if [ ! -e /bin/vs/media/connecting.g711a ]
then
show_error "Have no connecting audio"
return
else
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/playaudio.cgi?&-playstate=1&-playfile=connecting"
fi
}
ZBAR_LOG="/tmpfs/zbar.log"
count=1
tcount=120
#sleep 5
while([ $count -lt $tcount ])
do
while true
do
JPEG_PATH=`wget -q -O - "http://127.0.0.1/web/cgi-bin/hi3510/snap.cgi?&-chn=2"| cut -d\" -f2`
if [ "A""${JPEG_PATH}" == "A" ]
then
echo"snap failure!"
continue
else
break
fi
done
/usr/bin/zbar ${JPEG_PATH} > ${ZBAR_LOG}
rm ${JPEG_PATH} -rf
DATA_TYPE=`cat ${ZBAR_LOG} | grep QRcode -w| cut -d= -f2`
if [ ! -s $ZBAR_LOG ]
then
echo "Unscanned information!"
count=`expr $count + 1`
continue
elif [ "${DATA_TYPE}" == "wifi" ]
then
WIFI_SSID=`cat ${ZBAR_LOG} | grep wifie_ssid -w| cut -d= -f2`
if [ "A""${WIFI_SSID}" == "A" ]
then
echo "Scan failure,WIFI_SSID=NULL"
wifi_audio_connectfailure
break
else
echo "WIFI_SSID=${WIFI_SSID}"
fi
WIFI_KEY=`cat /tmpfs/zbar.log | grep wifi_key -w| cut -d= -f2`
echo "WIFI_KEY=${WIFI_KEY}"
wifi_audio_connecting
/bin/vslocal/cgi-bin/scanwifi.cgi
WIFI_TYPE=`cat /tmpfs/wifiaplist | grep $WIFI_SSID -w|awk -F" " '{print $4}'`
if [ "A""${WIFI_TYPE}" == "A" ]
then
echo "WIFI_SSID NO FIND!"
break
else
WIFI_WKTYPE=`echo $WIFI_TYPE | grep WPA`
if [ ! -z $WIFI_WKTYPE ]
then
SMTCN_WKTYPE="3"
else
WIFI_WKTYPE=`echo $WIFI_TYPE | grep [ESS]`
if [ ! -z $WIFI_WKTYPE ] && [ $WIFI_WKTYPE == "[ESS]" ]
then
SMTCN_WKTYPE="1"
else
SMTCN_WKTYPE="2"
fi
fi
fi
if [ ! -z "$WIFI_SSID" ]&&[ ! -z "$WIFI_TYPE" ]
then
/bin/vs/cgi-bin/setwifiattr.cgi "cmd=setwifiattr&-enable=1&-ssid=${WIFI_SSID}&-wktype=${SMTCN_WKTYPE}&-wepid=0&-key=${WIFI_KEY}"
fi
wifi_audio_connectsuccess
/bin/vslocal/cgi-bin/wifi_networking.sh "STA"
else
wifi_audio_connectfailure
fi
break
done

170
bin/vslocal/cgi-bin/p2p.cgi Normal file
View File

@ -0,0 +1,170 @@
#!/bin/sh
#偶尔会出问题, 先暂时屏蔽掉
# echo 200 OK HTTP 1.1
# echo
# echo var p2p_enable = "-1";
# echo -e "\r\n"
#
# exit
# '## /bin/vs/cgi-bin/p2p.cgi "&-action=get"'
# '##/bin/vs/cgi-bin/p2p.cgi "&-action=set&-enable=0"'
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
arg_p2p_action="`get_param "action"`"
p2p_tran=`paraconf r 1 P2P_TRAN`
if [ $? != 0 ]
then
p2p_tran=null
fi
. /etc/ipcamera/p2p.conf
#echo arg_p2p_action $arg_p2p_action
if [ $arg_p2p_action = "get" ]
then
#p2p_tran=`paraconf r 1 P2P_TRAN`
p2p_id=`paraconf r 1 P2P_ID`
p2p_ID=`echo $p2p_id | cut -d , -f1`
p2p_PWD=`paraconf r 1 P2P_PWD`
if [ $p2p_tran = null ]
then
var_p2p_enable=-1
else
. /etc/ipcamera/p2p.conf
#echo $p2p_enable
var_p2p_enable=$p2p_enable
fi
#echo "HTTP/1.0 200 OK"
#echo -e "Content-Type:text/html"\n
#echo 200 OK HTTP 1.1
#echo
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e var p2p_enable = \"${var_p2p_enable}\"\;"\r"
echo -e var p2p_id = \"${p2p_ID}\"\;"\r"
echo -e var p2p_pwd = \"${p2p_PWD}\"\;"\r"
echo -e "\r"
# echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"
exit
fi
arg_p2p_enable="`get_param "enable"`"
arg_p2p_pwd="`get_param "p2p_pwd"`"
arg_p2p_uid="`get_param "p2p_uid"`"
arg_p2p_tran="`get_param "p2p_tran"`"
arg_p2p_server="`get_param "p2p_server"`"
arg_p2p_extinfo="`get_param "p2p_extinfo"`"
arg_p2p_vendor="`get_param "p2p_vendor"`"
args=""
if [ $arg_p2p_action = "set" ]
then
if [ ! $arg_p2p_enable"A" = "A" ]
then
echo "p2p_enable=$arg_p2p_enable" >/etc/ipcamera/p2p.conf
fi
if [ ! $arg_p2p_pwd"A" = "A" ]
then
# /bin/paraconf w 1 P2P_PWD ${arg_p2p_pwd}
args="$args P2P_PWD ${arg_p2p_pwd}"
fi
if [ ! $arg_p2p_uid"A" = "A" ]
then
# echo p2pid "($arg_p2p_uid)"
# /bin/paraconf w 1 P2P_ID $arg_p2p_uid
args="$args P2P_ID $arg_p2p_uid"
fi
if [ ! $arg_p2p_tran"A" = "A" ]
then
# echo p2pid "($arg_p2p_tran)"
# /bin/paraconf w 1 P2P_TRAN $arg_p2p_tran
args="$args P2P_TRAN $arg_p2p_tran"
fi
if [ ! $arg_p2p_server"A" = "A" ]
then
# echo p2pid "($arg_p2p_server)"
# /bin/paraconf w 1 P2P_SERVER $arg_p2p_server
args="$args P2P_SERVER $arg_p2p_server"
fi
if [ ! $arg_p2p_extinfo"A" = "A" ]
then
# echo p2pid "($arg_p2p_extinfo)"
# /bin/paraconf w 1 P2P_EXTINFO $arg_p2p_extinfo
args="$args P2P_EXTINFO $arg_p2p_extinfo"
fi
if [ ! $arg_p2p_vendor"A" = "A" ]
then
# echo p2pid "($arg_p2p_vendor)"
# /bin/paraconf w 1 DEVICE_VENDOR $arg_p2p_vendor
args="$args DEVICE_VENDOR $arg_p2p_vendor"
fi
/bin/paraconf w 1 $args
syncVal=`cat /etc/ipcamera/config_rtpublic.ini | grep p2pwebpwdsync | cut -d = -f 2`
if [ ! $syncVal"A" = "A" ] && [ ! $arg_p2p_pwd"A" = "A" ]
then
if [ $syncVal = "1" ]
then
wget -O /tmpfs/updateuser "http://127.0.0.1/web/cgi-bin/hi3510/param.cgi?cmd=updateuser&user0=admin:${arg_p2p_pwd}:255:Admin"
rm /tmpfs/updateuser -rf
fi
fi
killall -9 $p2p_tran >/tmpfs/err 2>&1
#echo p2p_tran $p2p_tran
###if [ $arg_p2p_enable = 0 ]
###then
### #echo DEBUG p2p_enable $arg_p2p_enable
### #killall -9 p2p_deamon >/tmpfs/err 2>&1
### #killall -9 $p2p_tran >/tmpfs/err 2>&1
### #killall -9 start_p2p.sh >/tmpfs/err 2>&1
###
###else
### #if [ $arg_p2p_enable != $p2p_enable ]
### #then
### # /bin/vs/start_p2p.sh
### # fi
###fi
###
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo "OK"
# echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"
exit
fi

View File

@ -0,0 +1,64 @@
#!/bin/sh
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
arg_cmd="`get_param "cmd"`"
arg_part="`get_param "part"`"
if [ $arg_cmd"A" = "A" ]
then
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo "please set cmd"
exit
fi
if [ $arg_cmd = "format" ]
then
if [ $arg_part"A" = "A" ]
then
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo "please set part num 1|2|all"
exit
fi
if [ $arg_part = "all" ]
then
/bin/paraconf f 1
/bin/paraconf f 2
elif [ $arg_part = "1" ]
then
/bin/paraconf f 1
elif [ $arg_part = "2" ]
then
/bin/paraconf f 2
fi
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo "format success"
exit
fi

View File

@ -0,0 +1,35 @@
#!/bin/sh
config_mtd="/dev/mtd4"
etc_mtd="/dev/mtd3"
##保存一些特定值
devid=`paraconf r 2 devid`
upg_crc=`paraconf r 2 upg_crc`
###刷除config分区
flash_eraseall ${config_mtd}
flashcp /bin/vslocal/config.bin ${config_mtd}
###恢复etc分区
tar -xf /bin/vslocal/etc.tar -C /etc/
####恢复P2P密码
P2P_PWD_BK=`paraconf r 1 P2P_PWD_BK`
if [ "${P2P_PWD_BK}" == "null" ];then
P2P_PWD_BK="admin"
fi
STRING="P2P_PWD ${P2P_PWD_BK}"
if [ "${devid}" != "null" ];then
STRING="${STRING} devid "${devid}
fi
if [ "${upg_crc}" != "null" ];then
STRING="${STRING} upg_crc "${upg_crc}
fi
paraconf w 2 ${STRING}

View File

@ -0,0 +1,20 @@
#!/bin/sh
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
#. $wifi_config
wifim=$(wifi_getmode)
#wpa_cli -i $iface scan > /dev/null 2>&1
if [ $wifim = NONE ]
then
wifi_sta_start
wifi_scan
outputwifiscanresult
wifi_sta_stop
else
wifi_scan
outputwifiscanresult
fi

View File

@ -0,0 +1,159 @@
#!/bin/sh
#***********************************************************************
#
# setadslattr.cgi
# author:x57522
# TODO: check the configure information
# if the configure information is the same as before,do nothing
# else restart the adsl
#***********************************************************************
# Paths to programs
LOGGER="/usr/bin/logger -t `basename $0`"
CONFIG=/etc/ppp/pppoe.conf
ADSLCONF=/etc/ipcamera/adsl.conf
ECHO=/bin/echo
ADSLSTART=/usr/sbin/adsl-start
ADSLSTOP=/usr/sbin/adsl-stop
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
# Protect created files
umask 077
copy() {
cp $1 $2
if [ "$?" != 0 ] ; then
$ECHO "*** Error copying $1 to $2"
$ECHO "*** Quitting."
exit 1
fi
}
. $CONFIG
. $ADSLCONF
enable=`get_param "adslenable"`
#stop adsl
echo "$ADSLSTOP"
$ADSLSTOP > /dev/null 2>&1
#record the value of adslenable
#TODO:put it in the right place
echo "adslenable=$enable" > $ADSLCONF
if [ $enable = 1 ] ; then
#get USER
U="`get_param "username"`"
#get PWD
PWD="`get_param "password"`"
#get DNSTYPE
DNSAUTO="`get_param "dnsauto"`"
if [ $DNSAUTO = 1 ] ; then
DNSTYPE=SERVER
PEERDNS=yes
elif [ $DNSAUTO = 0 ] ; then
DNSTYPE=SPECIFY
PEERDNS=no
DNS1="`get_param "dns1"`"
DNS2="`get_param "dns2"`"
fi
#get ETH
#ETH=eth0
#get DEMAND
#D=
#get FIREWALL
#FIREWALL=
# Adjust configuration files. First to $CONFIG
#$ECHO "Adjusting $CONFIG"
copy $CONFIG $CONFIG-bak
# Where is pppd likely to put its pid?
if [ -d /var/run ] ; then
VARRUN=/var/run
else
VARRUN=/etc/ppp
fi
# Some #$(*& ISP's use a slash in the user name...
sed -e "s&^USER=.*&USER='$U'&" \
-e "s&^PIDFILE=.*&PIDFILE=\"$VARRUN/\$CF_BASE-adsl.pid\"&" \
-e "s/^DNSTYPE=.*/DNSTYPE=$DNSTYPE/" \
-e "s/^DNS1=.*/DNS1=$DNS1/" \
-e "s/^DNS2=.*/DNS2=$DNS2/" \
-e "s/^PEERDNS=.*/PEERDNS=$PEERDNS/" \
< $CONFIG-bak > $CONFIG
if [ $? != 0 ] ; then
#$ECHO "** Error modifying $CONFIG"
#$ECHO "** Quitting"
exit 1
fi
#if [ "$DNSTYPE" = "SPECIFY" ] ; then
# #$ECHO "Adjusting /etc/resolv.conf"
# if [ -r /etc/resolv.conf ] ; then
# grep -s "MADE-BY-RP-PPPOE" /etc/resolv.conf > /dev/null 2>&1
# if [ "$?" != 0 ] ; then
# $ECHO " (But first backing it up to /etc/resolv.conf-bak)"
# copy /etc/resolv.conf /etc/resolv.conf-bak
# fi
# fi
# $ECHO "# MADE-BY-RP-PPPOE" > /etc/resolv.conf
# $ECHO "nameserver $DNS1" >> /etc/resolv.conf
# if [ "$DNS2" != "" ] ; then
# $ECHO "nameserver $DNS2" >> /etc/resolv.conf
# fi
#fi
#$ECHO "Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets"
if [ -r /etc/ppp/pap-secrets ] ; then
#(But first backing it up to /etc/ppp/pap-secrets-bak)
copy /etc/ppp/pap-secrets /etc/ppp/pap-secrets-bak
else
cp /dev/null /etc/ppp/pap-secrets-bak
fi
if [ -r /etc/ppp/chap-secrets ] ; then
#(But first backing it up to /etc/ppp/chap-secrets-bak)
copy /etc/ppp/chap-secrets /etc/ppp/chap-secrets-bak
else
cp /dev/null /etc/ppp/chap-secrets-bak
fi
egrep -v "^$U|^\"$U\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
$ECHO "\"$U\" * \"$PWD\"" >> /etc/ppp/pap-secrets
egrep -v "^$U|^\"$U\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
$ECHO "\"$U\" * \"$PWD\"" >> /etc/ppp/chap-secrets
echo "$ADSLSTART"
$ADSLSTART > /dev/null 2>&1 &
fi
#echo $HTTP_REFERER
echo -e "\r\n"
echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"

View File

@ -0,0 +1,43 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
ap_config=/etc/network/wifiap.conf
ap_config_tmp=/tmpfs/wifiapconf
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
#newapname="`get_param "apname"`"
newapname=$1
echo new ap name: $newapname
oldapname="`cat $ap_config | grep ap_name | cut -d'=' -f2`"
oldapname="`echo $oldapname | awk -F" " '{print $2}'`"
echo old ap name: $oldapname
sed "s/=$oldapname/=$newapname/g" $ap_config > $ap_config_tmp
cp $ap_config_tmp $ap_config
rm $ap_config_tmp
echo -e "\r\n"
echo -e "[SUCCESS]SetWifiAttr OK"

View File

@ -0,0 +1,95 @@
#!/bin/sh
DDNSCONF=/etc/ipcamera/ddns.conf
DDNSENABLE=/etc/ipcamera/ddns_enable.conf
DIRINCLUDE=/usr/sbin/ddns
DDNSBIN=/bin/vs/ez-ipupdate
. ${DIRINCLUDE}/ddnsrc
. $DDNSCONF
. $DDNSENABLE
#REQUEST_METHOD(GET/POST)
#QUERY_STRING
#CONTENT_LENGTH
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
#parse the QUERY_STRING and get the param
ddnsenable="`get_param "ddnsenable"`"
if [ ${ddnsenable} -eq 1 ]
then
domain="`get_param "ddnsdomain"`"
user="`get_param "ddnsusername"`"
password="`get_param "ddnspassword"`"
ispname="`get_param "ddnsispname"`"
dnsserver="`get_param "ddnsdnsserver"`"
isproxy="`get_param "ddnsisproxy"`"
#interval="`get_param "ddnsinterval"`"
fi
upnpenable="`get_param "upnpenable"`"
#update the DDNSCONF file
if [ ${ddnsenable} -eq 1 ]
then
$RMCMD ${RUNDDNSCMD}
$LINKCMD -s $DIRINCLUDE/ddnsrun.$ispname ${RUNDDNSCMD}
echo DDNS_DOMAINNAME=\"$domain\" > $DDNSCONF
echo DDNS_USERNAME=\"$user\" >> $DDNSCONF
echo DDNS_USERPASSWORD=\"$password\" >> $DDNSCONF
echo DDNS_ISPNAME=\"$ispname\" >> $DDNSCONF
echo DDNS_DNSSERVER=\"$dnsserver\" >> $DDNSCONF
echo DDNS_ISPROXY=\"$isproxy\" >> $DDNSCONF
fi
echo DDNS_ENABLE=\"$ddnsenable\" > $DDNSENABLE
###################后台执行会有问题
echo 1 > /tmpfs/updateddns
#restart the ddns service
#if [ $ddnsenable -eq 1 ]
#then
# /usr/sbin/ddns/ddns-stop >> /dev/null
# /usr/sbin/ddns/ddns-start &
#else
# /usr/sbin/ddns/ddns-stop
#fi #if [ $enable -eq 1 ]
#start or stop upnp
#echo "upnpenable****************"
#echo $upnpenable
#if [ $upnpenable -eq 1 ]
#then
# ./upnp_start.cgi > /dev/null 2>&1
#else
# ./upnp_stop.cgi > /dev/null 2>&1
#fi
#echo $HTTP_REFERER
echo -e "\r\n"
#echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"
echo -e [SUCCESS]setddnsattr OK

View File

@ -0,0 +1,30 @@
#!/bin/sh
CONFIG_PATH_MNT="/mnt"
CONFIG_DEFAULT="/bin/vslocal/config_default.bin"
CONFIG_TMP_DEFAULT="/tmpfs/config_default.bin"
CONFIG_DEFFALT_EXCLUDE_FILE="/mnt/config/exclude.lst"
producttype=`cat /etc/ipcamera/config_devm.ini | grep ^producttype | awk -F "=" '{printf $2}'`
if [ -z $producttype ];then
exit
fi
if [ $producttype == "29" ] || [ $producttype == "30" ]; then
echo "============720p============="
cp /etc/ipcamera/config_devm.ini /etc/ipcamera/conf_720p/
cp /etc/ipcamera/ipc6000/config_mpmng.ini /etc/ipcamera/conf_720p/
elif [ $producttype == "31" ];then
echo "============1080p============="
cp /etc/ipcamera/config_devm.ini /etc/ipcamera/conf_1080p/
cp /etc/ipcamera/ipc1080p/config_mpmng.ini /etc/ipcamera/conf_1080p/
elif [ $producttype == "32" ];then
echo "============960p============="
cp /etc/ipcamera/config_devm.ini /etc/ipcamera/conf_960p/
cp /etc/ipcamera/ipc6000/config_mpmng.ini /etc/ipcamera/conf_960p/
fi
tar -X /mnt/config/exclude.lst -czvf $CONFIG_TMP_DEFAULT $CONFIG_PATH_MNT && cp $CONFIG_TMP_DEFAULT $CONFIG_DEFAULT -raf

View File

@ -0,0 +1,197 @@
#!/bin/sh
#***********************************************
#***********************************************
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
IFCONF=/etc/network/ifattr
IFCONF_BAK=/tmpfs/ifattr
IFRESOLV=/etc/network/resolv.conf
RESOLV=/etc/resolv.conf
NETDEV=/tmpfs/netdev
iface=`cat $NETDEV`
#REQUEST_METHOD=GET
#REQUEST_METHOD(GET/POST)
#QUERY_STRING="-ipaddr=192.168.0.159&-netmask=255.255.255.0&-gateway=192.168.0.1&-dhcp=off&-dnsstat=0&-fdnsip=10.72.255.1&-sdnsip=10.72.55.22&httpport=8"
#QUERY_STRING="-ipaddr=192.168.0.132&-netmask=255.255.255.0&-gateway=192.168.0.1&-hwaddr=00:80:47:2D:76:53&"
#CONTENT_LENGTH
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
#parse the QUERY_STRING and get the param
p_dhcp="`get_param "dhcp"`"
p_dnstype="`get_param "dnsstat"`"
p_address="`get_param "ipaddr"`"
p_netmask="`get_param "netmask"`"
p_gateway="`get_param "gateway"`"
p_dns1="`get_param "fdnsip"`"
p_dns2="`get_param "sdnsip"`"
p_hwaddr="`get_param "hwaddr"`"
p_configmini=N
. $IFCONF
if [ $p_dhcp"A" = "A" ]
then
p_dhcp=$dhcp
fi
if [ $p_dnstype"A" = "A" ]
then
p_dnstype=$dnstype
fi
if [ $p_address"A" = "A" ]
then
p_configmini=Y
p_address=$address
fi
if [ $p_netmask"A" = "A" ]
then
p_netmask=$netmask
fi
if [ $p_gateway"A" = "A" ]
then
p_gateway=$gateway
fi
if [ $p_hwaddr"A" = "A" ]
then
p_hwaddr=`/bin/paraconf r 1 mac`
fi
# 没有mac参数
if [ $p_hwaddr"A" = "A" ]
then
#echo "Do nothing"
XY=0
else
mac=`/bin/paraconf r 1 mac`
ret=$?
#echo $mac to $p_hwaddr
if [ ${ret} -ne 0 ]
then
mac=$p_hwaddr
fi
if [ $mac"A" != $p_hwaddr"A" ]
then
/bin/paraconf w 1 mac $p_hwaddr
ifconfig $iface hw ether $p_hwaddr
echo "macaddress=$mac" > $mac_lined_file
if [ $p_configmini = "Y" ]
then
##不配置ip情况下, 其他信息没有必要配置.
##echo "mini config"
exit
fi
fi
fi
#echo IP:$p_address
if [ "$p_dhcp" = "on" ];then
p_dhcp=y
elif [ "$dp_hcp" = "off" ];then
p_dhcp=n
else
p_dhcp=n
fi
if [ "$p_dnstype" = "1" ];then
### 使用dhcp分配的dns server
p_dnstype=server
elif [ "$p_dnstype" = "0" ];then
p_dnstype=specify
else
p_dnstype=specify
fi
##. $IFCONF
#save ifattr
cp -f $IFCONF $IFCONF_BAK > /dev/null
if [ "$p_dhcp" = y ];then
sed -e "s/^dhcp=.*/dhcp=$p_dhcp/" \
-e "s/^dnstype=.*/dnstype=$p_dnstype/" \
$IFCONF_BAK > $IFCONF
elif [ "$p_dhcp" = "n" ];then
sed -e "s/^dhcp=.*/dhcp=$p_dhcp/" \
-e "s/^dnstype=.*/dnstype=$p_dnstype/" \
-e "s/^address=.*/address=$p_address/" \
-e "s/^netmask=.*/netmask=$p_netmask/" \
-e "s/^gateway=.*/gateway=$p_gateway/" \
$IFCONF_BAK > $IFCONF
fi
#save dns
if [ "$p_dnstype" = specify ];then
if [ "$p_dns1" = "" ] && [ "$p_dns2" = "" ]
then
xx=""
else
echo -n > $IFRESOLV
if [ "$p_dns1" != "" ]
then
echo nameserver $p_dns1 >> $IFRESOLV
fi
if [ "$p_dns2" != "" ]
then
echo nameserver $p_dns2 >> $IFRESOLV
fi
fi
widedns=`grep "8.8.8.8" $IFRESOLV`
if [ -z $widedns ]
then
echo nameserver 8.8.8.8 >> $IFRESOLV
fi
fi
. $IFCONF
net_setip_currdev
#echo $HTTP_REFERER
#echo -e "\r\n"
#echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" #content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"

View File

@ -0,0 +1,150 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
IFS=";"
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
####config_path=/etc/network
####wifi_config=$config_path/wifi.conf
####wifi_config_tmp=/tmpfs/wifi.conf
####wifidev_config=$config_path/wifidev.conf
. $wifi_config
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
wifiessidold=$wifiessid
wifiwhichkeyold=$wifiwhichkey
ssid="`get_param "ssid"`"
wktype="`get_param "wktype"`"
wepid="`get_param "wepid"`"
enable="`get_param "enable"`"
wifiessid=$ssid
#wifistatus=$wfstatus
wifiwhichkey=$wepid
#wifimode=$wkmode
wifikeytype=$wktype
#wifiencryp=$wpatype
wifiwhichkey=0
#wifikey1old="$wifikey1"
#wifikey2old="$wifikey2"
#wifikey3old="$wifikey3"
wifikeyold="$wifikey"
#wifikey1="`get_param "wkd1"`"
#wifikey2="`get_param "wkd2"`"
#wifikey3="`get_param "wkd3"`"
wifikey="`get_param "key"`"
cat $wifidev_config > $wifi_config_tmp
echo "wifidev=\"${wifidev}\"" >> $wifi_config_tmp
echo "wifienable=\"${enable}\"" >> $wifi_config_tmp
#echo "channel=\"${channel}\"" >> $wifi_config_tmp
#echo "wifimode=\"${wifimode}\"" >> $wifi_config_tmp
echo "wifiessid=\"${wifiessid}\"" >> $wifi_config_tmp
#echo "wifirate=${wifirate}" >> $wifi_config_tmp
#echo "wifistatus=$wifistatus" >> $wifi_config_tmp
echo "wifikeytype=$wifikeytype" >> $wifi_config_tmp
echo "wifiwhichkey=$wifiwhichkey" >> $wifi_config_tmp
echo "wifikey=\"$wifikey\"" >> $wifi_config_tmp
#echo "wifikey2=\"$wifikey2\"" >> $wifi_config_tmp
#echo "wifikey3=\"$wifikey3\"" >> $wifi_config_tmp
#echo "wifikey4=\"$wifikey4\"" >> $wifi_config_tmp
#echo "wifiencryp=$wifiencryp" >> $wifi_config_tmp
cat $wifi_config_tmp > $wifi_config
#"$wifiessid=$1"
#"$wifikey=$2"
#"$wifikeytype=$3"
#无加密时key为空,导致传进去的参数会少一个
if [ $wifikey"A" == "A" ];then
wifikey="0"
fi
gen_wpa_config $wifiessid $wifikeytype $wifiwhichkey $wifikey $wpa_config_tmp
cp -f $wpa_config_tmp $wpa_config
#wifi_sta_save_info ${wifiessid} ${wifikey} ${wifikeytype}
#show_dbg2 "wpa_config_tmp:$wpa_config_tmp"
#gen_wpa_config $wifiessid $wifikeytype $wifiwhichkey $wifikey $wpa_config_tmp
#cp -f $wpa_config_tmp $wpa_config
#####wifim=$(wifi_getmode)
#####if [ $wifim = AP ]
#####then
##### ####BTTODO
##### ### echo "reboot" > /tmpfs/sysmon
##### ##echo "WIFI_STA" > /tmpfs/sysmon
##### ##fsync /tmpfs/sysmon
#####
##### wifi_networking.sh STA
#####else
##### wifi_networking.sh STA
#####fi
linedstatus=$(net_getlinedstatus)
show_info "setwifiattr, linestatus $linedstatus "
if [ $linedstatus = 0 -o $linedstatus = 2 ]
then
wifim=$(wifi_getmode)
if [ $wifim = "AP" ]
then
. $ap_cfgfile
if [ $ap_after_config = "STA" ]
then
show_info1 "wificonfig under AP. toSTA"
wifi_networking.sh STA
elif [ $ap_after_config = "REBOOT" ]
then
show_info1 "wificonfig under AP. reboot"
sys_setaction "reboot"
else
show_info1 "wificonfig under AP. do nothing"
fi
else
show_info "wificonfig under STA, connect with new config"
wifi_networking.sh STA
fi
fi
echo -e "\r\n"
#echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"
echo -e "[SUCCESS]SetWifiAttr OK"
# /bin/vs/cgi-bin/inetwifi_configig.cgi

View File

@ -0,0 +1 @@
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/param.cgi?cmd=snap&-chn=0&-bSaveSD=1"

View File

@ -0,0 +1 @@
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/rec_manual_switch.cgi?-chn=11"

View File

@ -0,0 +1,20 @@
#! /bin/sh
CONF=/etc/ipcamera/upnp.conf
WEBSERVER=/etc/ipcamera/webserver.conf
. $CONF
PORT=`grep 'port' $WEBSERVER |sed -n "s/ /\n/gp"|grep 'port'|sed -n "s/\port=//p"`
#echo "the naum" $PORT
iface=`cat $NETDEV`
killall -9 upnpd
if [ $enable = 1 ]
then
#/bin/vs/upnpd -i eth0 -P $PORT -w /etc/ipcamera -n "$upnpname"
#/bin/vs/upnpd -i wlan0 -P $PORT -w /etc/ipcamera -n "$upnpname"
/bin/vs/upnpd -i $iface -P $PORT -w /etc/ipcamera -n "$upnpname"
fi

View File

@ -0,0 +1,45 @@
#!/bin/sh
## $1 AP|STA
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
##wifi_sta_stop
##wifi_ap_stop
netact=NONE
if [ -z $1 ]
then
netact=TO_STA
else
if [ $1 == "AP" ]
then
netact=TO_AP
elif [ $1 == "STA" ]
then
netact=TO_STA
elif [ $1 == "WPS" ]
then
netact=TO_WPS
elif [ $1 == "SMTCN" ]
then
netact=TO_SMTCN
elif [ $1 == "FATCN" ]
then
netact=TO_FATCN
elif [ $1 == "FIXNET" ]
then
netact=TO_FIXNET
else
netact=$1
fi
fi
net_setaction $netact

View File

@ -0,0 +1,11 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
net_setaction TO_WPS

View File

@ -0,0 +1,36 @@
#!/bin/sh
#Normal Version
### 0 灭(no wifi), 1 亮(wifi ok), 2 (wifi AP) 3(wifi wps) 4(wifi failed)
#NoWifi(0) OFF
#Wifi OK(1) ON
# AP(2) 长闪烁
# WPS(3) 短闪烁
# FAILED(4) 一长3短
wifi_ledflash()
{
#####333320(81)/333321(k2) 晶传A1固件wifi闪灯需求
#####332330(L17)wifi闪灯需求/334330(L18)/338330(L22软开机)/342330(113带光敏)
#####338321(L26)和L22相比少了一个抓拍按键
#####343321(T66)和L21的基本功能一样,但多了一个IRCUT,加对讲aac库
#####上述这些机型都按如下需求闪烁
if [ $1 == "1" ]; #wifi OK
then
#ledflash 1 1 0 #红灯亮
echo "wifi_connected" > /proc/rt/led
elif [ $1 == "2" ]; #AP
then
#ledflash 1 2 0 #红灯慢闪
echo "ap_mode" > /proc/rt/led
elif [ $1 == "4" ];#FAILED
then
#ledflash 1 3 0 #红灯快闪
echo "wifi_connect_error" > /proc/rt/led
fi
return ;
}

View File

@ -0,0 +1,47 @@
#!/bin/sh
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
arg_p2p_action="`get_param "action"`"
if [ $arg_p2p_action = "ap" ]
then
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "entern AP mode OK !!!!\r"
echo -e "\r"
/bin/vs/cgi-bin/wifi_networking.sh AP &
exit
fi
if [ $arg_p2p_action = "wps" ]
then
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "entern WPS mode OK !!!!\r"
echo -e "\r"
/bin/vs/cgi-bin/wifi_wps.sh &
exit
exit
fi

View File

@ -0,0 +1,126 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs:/komod
## 执行方法为/bin/vs/cgi-bin/wifitest.cgi "&-ssid=dbt2&-wktype=3&-key=qv1234563"
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
IFS=";"
. $wifidev_config
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
wifim=$(wifi_getmode)
echo "">/tmpfs/wifitest.log
if [ $wifim = "AP" ]
then
show_dbg2 "wifitest, but in AP mode. not support"
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e var wifi_linkstatus=\"AP_MODE\"\;"\r"
echo -e "\r"
exit
elif [ $wifim = "NONE" ]
then
/komod/wifiko.sh load
show_dbg2 "wifitest, not wifi mode.load wifi"
##wifiko load
#/komod/mt7601.sh "load"
#ifconfig $wifidev up
net_up $wifidev
echo "STA" > $wifimode
elif [ $wifim = "STA" ]
then
show_dbg2 "wifitest, wifi mode.disable prev first"
wpa_cli -i $wifidev disconnect >>/tmpfs/wifitest.log 2>&1
wpa_cli -i $wifidev terminate >>/tmpfs/wifitest.log 2>&1
fi
wifiessid="`get_param "ssid"`"
wifikeytype="`get_param "wktype"`"
wifiwhichkey="`get_param "wepid"`"
wifikey="`get_param "key"`"
###目前仅处理key0
wifiwhichkey=0
gen_wpa_config $wifiessid $wifikeytype $wifiwhichkey $wifikey $wpa_config_tmp
wpa_supplicant -B -d -D$wpa_driver -i $wifidev -c $wpa_config_tmp >>/tmpfs/wifitest.log 2>&1
wpa_cli -i $wifidev disconnect >>/tmpfs/wifitest.log 2>&1
wpa_cli -i $wifidev select_network 0 >>/tmpfs/wifitest.log 2>&1
wpa_cli -i $wifidev enable_network 0 >>/tmpfs/wifitest.log 2>&1
###linkstatus=$(wifi_wait_connect)
retry_times=5
retry_waittimes=3
cnt=0
show_dbg2 "wifiessid:${wifiessid} wifikey:${wifikey}"
##show_dbg2 "wifi_wait_connect retry_times $retry_times retry_waittimes $retry_waittimes"
while [ $cnt -lt $retry_times ]
do
linkstatus=$(wifi_getstatus)
if [ -z $linkstatus ]
then
linkstatus=ERROR
break
else
### 只有COMPLETED 才是链接成功, 可能的值为 SCANNING, ASSOCIATING,SCANNING
if [ ${linkstatus} = COMPLETED ]
then
linkstatus="COMPLETED"
break
else
sleep $retry_waittimes
cnt=`expr $cnt + 1`
fi
fi
done
## 重新启动wpa_supplicant
if [ $wifim = STA ]
then
#ifconfig $wifidev up
net_up $wifidev
wifi_sta_connect
else
wpa_cli -i $wifidev disconnect >>/tmpfs/wifitest.log 2>&1
wpa_cli -i $wifidev terminate >>/tmpfs/wifitest.log 2>&1
fi
show_dbg2 " test linkstatus ${linkstatus}"
if [ $wifim = "NONE" ]
then
echo "NONE" > $wifimode
fi
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e var wifi_linkstatus=\"${linkstatus}\"\;"\r"
echo -e "\r"
#echo "<html><head><title></title><META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><META http-equiv=\"Refresh\" #content=\"0;URL=$HTTP_REFERER\"></head><body></body></html>"

71
bin/vslocal/custom_run.sh Normal file
View File

@ -0,0 +1,71 @@
#!/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"

View File

@ -0,0 +1,57 @@
#!/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
sd_testpath=/bin/vslocal/sd/VAL_TEST/
wifitest=${sd_testpath}/wifi_test.conf
if [ ! -e /dev/mmcblk0 ];then
echo -e "\033[45;37m[VAL_TEST]Exit custom test\033[0m"
exit
fi
#####挂载SD卡,不存在/dev/mmcblk0p1节点时使用/dev/mmcblk0
if [ ! -e /dev/mmcblk0p1 ];then
mount -t vfat /dev/mmcblk0 /bin/vslocal/sd
else
mount -t vfat /dev/mmcblk0p1 /bin/vslocal/sd
fi
#####是否挂载成功
sdInfo=`mount | grep "/bin/vslocal/sd" | awk '{print $1}'`
if [ $sdInfo"A" == "A" ];then
echo -e "\033[45;37m[VAL_TEST]Exit custom test\033[0m"
exit
fi
if [ -d ${sd_testpath} ];then
#######把这个目录拷贝到/tmpfs/
cp ${sd_testpath} /tmpfs/ -raf
if [ -x $wifitest ];then
chmod +x $wifitest
. $wifitest
if [ ! -z $wifissid ];then
if [ ! -z $wifikey ];then
########先保存原来的配置
cp $wifi_config $wifi_config.bak
/bin/vs/cgi-bin/setwifiattr.cgi "cmd=setwifiattr&-enable=1&-ssid=${wifissid}&-wktype=3&-wepid=0&-key=${wifikey}"
fi
fi
fi
fi
#######卸载SD卡
umount /bin/vslocal/sd -l
if [ -x /bin/vslocal/custom_run.sh ];then
/bin/vslocal/custom_run.sh &
fi

1
bin/vslocal/log Symbolic link
View File

@ -0,0 +1 @@
/tmpfs

8
bin/vslocal/mcast.sh Normal file
View File

@ -0,0 +1,8 @@
if [ -z $1 ]
then
sleep 25
else
sleep $1
fi
/bin/vs/cgi-bin/devscast.sh

45
bin/vslocal/sysmon.sh Normal file
View File

@ -0,0 +1,45 @@
#
#连接或者断开
#!/bin/sh
###全局变量
# $1 config file
# $2
. /bin/vs/cgi-bin/netenv.conf
while [ 1 ]
do
action=none
if [ -e /tmpfs/sysmon ]
then
action=`cat /tmpfs/sysmon`
if [ $action"A" = "A" ]
then
action=none
fi
fi
if [ $action == devsrejoin ]
then
echo "Rejoin DEVSearch"
/bin/vs/mcast.sh 5
rm /tmpfs/sysmon -f
elif [ $action == reboot ]
then
echo "TO REBOOT by sysmon"
sync
sleep 3
reboot
elif [ $action == WIFI_STA ]
then
echo "TO Enter STA mode"
sleep 1
/bin/vs/cgi-bin/wifi_networking.sh STA
rm /tmpfs/sysmon -f
fi
sleep 2
done

1
bin/vslocal/tmpfs Symbolic link
View File

@ -0,0 +1 @@
/tmpfs

1
etc/TZ Symbolic link
View File

@ -0,0 +1 @@
/etc/ipcamera/TZ

View File

@ -0,0 +1 @@
/tmpfs/RT2870AP.dat

View File

@ -0,0 +1,119 @@
#The word of "Default" must not be removed
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=TW
BssidNum=1
SSID=IPCAM-AP
WirelessMode=9
TxRate=0
Channel=3
BasicRate=15
BeaconPeriod=100
DtimPeriod=1
TxPower=100
DisableOLBC=0
BGProtection=0
TxAntenna=
RxAntenna=
TxPreamble=0
RTSThreshold=2347
FragThreshold=2346
TxBurst=1
PktAggregate=0
TurboRate=0
WmmCapable=0
APSDCapable=0
DLSCapable=0
APAifsn=3;7;1;1
APCwmin=4;4;3;2
APCwmax=6;10;4;3
APTxop=0;0;94;47
APACM=0;0;0;0
BSSAifsn=3;7;2;2
BSSCwmin=4;4;3;2
BSSCwmax=10;10;4;3
BSSTxop=0;0;94;47
BSSACM=0;0;0;0
AckPolicy=0;0;0;0
NoForwarding=0
NoForwardingBTNBSSID=0
HideSSID=0
StationKeepAlive=0
ShortSlot=1
AutoChannelSelect=0
IEEE8021X=0
IEEE80211H=0
CSPeriod=10
WirelessEvent=0
IdsEnable=0
AuthFloodThreshold=32
AssocReqFloodThreshold=32
ReassocReqFloodThreshold=32
ProbeReqFloodThreshold=32
DisassocFloodThreshold=32
DeauthFloodThreshold=32
EapReqFooldThreshold=32
PreAuth=0
AuthMode=OPEN
EncrypType=NONE
RekeyInterval=0
RekeyMethod=DISABLE
PMKCachePeriod=10
WPAPSK=
DefaultKeyID=1
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
HSCounter=0
AccessPolicy0=0
AccessControlList0=
AccessPolicy1=0
AccessControlList1=
AccessPolicy2=0
AccessControlList2=
AccessPolicy3=0
AccessControlList3=
WdsEnable=0
WdsEncrypType=NONE
WdsList=
WdsKey=
RADIUS_Server=192.168.2.3
RADIUS_Port=1812
RADIUS_Key=ralink
own_ip_addr=192.168.5.234
EAPifname=br0
PreAuthifname=br0
HT_HTC=0
HT_RDG=0
HT_EXTCHA=0
HT_LinkAdapt=0
HT_OpMode=0
HT_MpduDensity=5
HT_BW=1
HT_AutoBA=1
HT_AMSDU=0
HT_BAWinSize=64
HT_GI=1
HT_MCS=33
MeshId=MESH
MeshAutoLink=1
MeshAuthMode=OPEN
MeshEncrypType=NONE
MeshWPAKEY=
MeshDefaultkey=1
MeshWEPKEY=
WscManufacturer=
WscModelName=
WscDeviceName=
WscModelNumber=
WscSerialNumber=
RadioOn=1
PMFMFPC=0
PMFMFPR=0
PMFSHA256=0

View File

@ -0,0 +1,19 @@
#The word of "Default" must not be removed, maximum 32 cards, 00 ~ 31
Default
#CARDID, MAC, CARDTYPE
SELECT=CARDTYPE
00CARDID=/etc/Wireless/RT2870AP/RT2870AP1.dat
01CARDID=/etc/Wireless/RT2870AP/RT2870AP2.dat
02CARDID=/etc/Wireless/RT2870AP/RT2870AP3.dat
00MAC00:0E:2E:C3:D0:48=/etc/Wireless/RT2870AP/RT2870AP1.dat
01MAC00:40:F4:FF:AA:40=/etc/Wireless/RT2870AP/RT2870AP2.dat
02MAC00:0C:43:10:11:5C=/etc/Wireless/RT2870AP/RT2870AP3.dat
00CARDTYPEbgn=/etc/Wireless/RT2870AP/RT2870AP1.dat
01CARDTYPEbgn=/etc/Wireless/RT2870AP/RT2870AP2.dat
02CARDTYPEabgn=/etc/Wireless/RT2870AP/RT2870AP3.dat

View File

@ -0,0 +1,104 @@
#The word of "Default" must not be removed
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=
ChannelGeography=1
SSID=RT7601AP
NetworkType=Infra
WirelessMode=3
Channel=0
BeaconPeriod=100
TxPower=100
BGProtection=0
TxPreamble=0
RTSThreshold=2347
FragThreshold=2346
TxBurst=1
PktAggregate=0
WmmCapable=1
AckPolicy=0;0;0;0
AuthMode=OPEN
EncrypType=NONE
WPAPSK=
DefaultKeyID=1
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
PSMode=CAM
AutoRoaming=0
RoamThreshold=70
APSDCapable=0
APSDAC=0;0;0;0
HT_RDG=1
HT_EXTCHA=0
HT_OpMode=0
HT_MpduDensity=4
HT_BW=1
HT_BADecline=0
HT_AutoBA=1
HT_AMSDU=0
HT_BAWinSize=64
HT_GI=1
HT_MCS=33
HT_MIMOPSMode=3
HT_DisallowTKIP=1
HT_STBC=1
EthConvertMode=
EthCloneMac=
IEEE80211H=0
TGnWifiTest=0
WirelessEvent=0
MeshId=MESH
MeshAutoLink=1
MeshAuthMode=OPEN
MeshEncrypType=NONE
MeshWPAKEY=
MeshDefaultkey=1
MeshWEPKEY=
CarrierDetect=0
AntDiversity=0
BeaconLostTime=4
FtSupport=0
Wapiifname=ra0
WapiPsk=
WapiPskType=
WapiUserCertPath=
WapiAsCertPath=
PSP_XLINK_MODE=0
WscManufacturer=
WscModelName=
WscDeviceName=
WscModelNumber=
WscSerialNumber=
RadioOn=1
WIDIEnable=1
P2P_L2SD_SCAN_TOGGLE=3
Wsc4digitPinCode=0
P2P_WIDIEnable=0
PMFMFPC=0
PMFMFPR=0
PMFSHA256=0
BW20_RSSI_THR0=-36
BW20_RSSI_THR1=-50
BW20_RSSI_THR2=-75
BW20_RSSI_THR3=-80
BW40_RSSI_THR0=-35
BW40_RSSI_THR1=-49
BW40_RSSI_THR2=-76
BW40_RSSI_THR3=-80
NOISE_RSSI_THR1=-62
NOISE_RSSI_THR2=-70
NOISE_RSSI_THR3=-75
FCCA_THR1=1800
FCCA_THR2=200
DYPD_ENABLE=1
WOW_Enable=1
WOW_InBand=0
EDCCA_ED_TH=80
EDCCA_BLOCK_CHECK_TH=2

View File

@ -0,0 +1,95 @@
#The word of "Default" must not be removed
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=
ChannelGeography=1
SSID=11n-AP
NetworkType=Infra
WirelessMode=9
Channel=0
BeaconPeriod=100
TxPower=100
BGProtection=0
TxPreamble=0
RTSThreshold=2347
FragThreshold=2346
TxBurst=1
PktAggregate=0
WmmCapable=1
AckPolicy=0;0;0;0
AuthMode=OPEN
EncrypType=NONE
WPAPSK=
DefaultKeyID=1
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
PSMode=CAM
AutoRoaming=0
RoamThreshold=70
APSDCapable=0
APSDAC=0;0;0;0
HT_RDG=1
HT_EXTCHA=0
HT_OpMode=0
HT_MpduDensity=4
HT_BW=1
HT_BADecline=0
HT_AutoBA=1
HT_AMSDU=0
HT_BAWinSize=64
HT_GI=1
HT_MCS=33
HT_MIMOPSMode=3
HT_DisallowTKIP=1
HT_STBC=0
EthConvertMode=
EthCloneMac=
IEEE80211H=0
TGnWifiTest=0
WirelessEvent=0
MeshId=MESH
MeshAutoLink=1
MeshAuthMode=OPEN
MeshEncrypType=NONE
MeshWPAKEY=
MeshDefaultkey=1
MeshWEPKEY=
CarrierDetect=0
AntDiversity=0
BeaconLostTime=4
FtSupport=0
Wapiifname=ra0
WapiPsk=
WapiPskType=
WapiUserCertPath=
WapiAsCertPath=
PSP_XLINK_MODE=0
WscManufacturer=
WscModelName=
WscDeviceName=
WscModelNumber=
WscSerialNumber=
RadioOn=1
WIDIEnable=1
P2P_L2SD_SCAN_TOGGLE=3
Wsc4digitPinCode=0
P2P_WIDIEnable=0
PMFMFPC=0
PMFMFPR=0
PMFSHA256=0
RSSI_THR1=-45
RSSI_THR2=-60
RSSI_THR3=-75
NOISE_RSSI_THR1=-62
NOISE_RSSI_THR2=-70
NOISE_RSSI_THR3=-75
FCCA_THR1=800
FCCA_THR2=10
DYPD_ENABLE=1

View File

@ -0,0 +1,19 @@
#The word of "Default" must not be removed, maximum 32 cards, 00 ~ 31
Default
#CARDID, MAC, CARDTYPE
SELECT=CARDTYPE
00CARDID=/etc/Wireless/RT2870STA/RT2870STA1.dat
01CARDID=/etc/Wireless/RT2870STA/RT2870STA2.dat
02CARDID=/etc/Wireless/RT2870STA/RT2870STA3.dat
00MAC00:0E:2E:C3:D0:48=/etc/Wireless/RT2870STA/RT2870STA1.dat
01MAC00:40:F4:FF:AA:40=/etc/Wireless/RT2870STA/RT2870STA2.dat
02MAC00:0C:43:10:11:5C=/etc/Wireless/RT2870STA/RT2870STA3.dat
00CARDTYPEbgn=/etc/Wireless/RT2870STA/RT2870STA1.dat
01CARDTYPEbgn=/etc/Wireless/RT2870STA/RT2870STA2.dat
02CARDTYPEabgn=/etc/Wireless/RT2870STA/RT2870STA3.dat

1
etc/board.conf Symbolic link
View File

@ -0,0 +1 @@
ipcamera/board.conf

1
etc/boottab Symbolic link
View File

@ -0,0 +1 @@
ipcamera/boottab

1
etc/devinfo Normal file
View File

@ -0,0 +1 @@
VVVIPC2111167232

2
etc/dnsd.conf Normal file
View File

@ -0,0 +1,2 @@
captive.apple.com 192.168.234.1

1
etc/fs-version Normal file
View File

@ -0,0 +1 @@
01000100 rootbox nohelp info

3
etc/fstab Normal file
View File

@ -0,0 +1,3 @@
proc /proc proc defaults,nodev,nosuid 0 0
sysfs /sys sysfs defaults,nodev,nosuid 0 0
tmpfs /dev tmpfs defaults 0 0

3
etc/group Normal file
View File

@ -0,0 +1,3 @@
root::0:
tty::0:
audio::0:

1
etc/info Normal file
View File

@ -0,0 +1 @@
ipc723000

17
etc/init.d/S00devs Normal file
View File

@ -0,0 +1,17 @@
#!/bin/sh
mknod /dev/console c 5 1
mknod /dev/ttyAMA0 c 204 64
mknod /dev/ttyAMA1 c 204 65
mknod /dev/ttyS000 c 204 64
mknod /dev/null c 1 3
echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s
mkdir /dev/pts
mount -t devpts devpts /dev/pts
mount tmpfs /tmpfs -t tmpfs -o size=4m
mount -t jffs2 /dev/mtdblock3 /etc/ipcamera/

56
etc/init.d/S02upgrade Normal file
View File

@ -0,0 +1,56 @@
#!/bin/sh
dev_node="/dev/mmcblk0p1"
sd_mount_dir=/bin/vslocal/sd
upg_file="rt-upgrade-gk7205v200.ov"
###SD设备节点都不在
if [ -e /dev/mmcblk0p1 ];then
dev_node="/dev/mmcblk0p1"
elif [ -e /dev/mmcblk0 ];then
dev_node="/dev/mmcblk0"
else
exit
fi
insmod /komod/extdrv/exfat.ko
mount -t exfat ${dev_node} ${sd_mount_dir}
ls ${sd_mount_dir}
if [ ! -e ${sd_mount_dir}/${upg_file} ];then
umount -l ${sd_mount_dir}
rmmod exfat;
exit;
fi
###检验升级包是否已经升级过,升级包的前4个字节是CRC
file_crc=`packet_crc ${sd_mount_dir}/${upg_file}`
save_crc=`paraconf r 2 upg_crc`
echo "file_crc":${file_crc}"===========save_crc":${save_crc}
if [ "${file_crc}" == "${save_crc}" ];then
umount -l ${sd_mount_dir}
rmmod exfat;
exit;
fi
insmod /komod/extdrv/led.ko
echo "upgrade_begin" > /proc/rt/led
umount -l ${sd_mount_dir}
umount -l /etc/ipcamera
cp /usr/sbin/upgrade.sh /tmpfs/
chmod +x /tmpfs/upgrade.sh
/tmpfs/upgrade.sh

11
etc/init.d/S03chkcfg Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
###customernum一定在config分区
###读取不到的话,说明分区出问题了
customernum=`paraconf r 2 customernum`
if [ "${customernum}" == "null" ];then
config_mtd="/dev/mtd4"
###刷除config分区
flash_eraseall ${config_mtd}
flashcp /bin/vslocal/config.bin ${config_mtd}
fi

12
etc/init.d/S05SetDefP2P Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
####默认ID与密码
DEFAULT_P2P_ID="DOG002-999999-AAAAA,AAAAAA"
DEFAULT_P2P_PWD="luohe"
####如果没有默认P2P_ID的设置一个默认值
P2P_ID=`paraconf r 1 P2P_ID`
if [ "${P2P_ID}" == "null" ];then
paraconf w 1 P2P_ID ${DEFAULT_P2P_ID} P2P_PWD_BK ${DEFAULT_P2P_PWD}
paraconf w 2 P2P_PWD ${DEFAULT_P2P_PWD}
fi

19
etc/init.d/S10mpp Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
sysctl -p
echo eth0 > /tmpfs/netdev
ifconfig lo 127.0.0.1
ifconfig lo up
telnetd -p 8357 &
mac=11:22:33:44:55:66
mac_path=/tmpfs/net/
mkdir -p $mac_path
mac_lined_file=$mac_path/mac.lined
echo "macaddress=$mac" > $mac_lined_file
sync
/etc/boottab &

22
etc/init.d/rcS Normal file
View File

@ -0,0 +1,22 @@
#! /bin/sh
/bin/mount -a
echo "
_ _ _ _ _ _ _ _ _ _ _ _
\ _ _ _ _ _ ___
/ /__/ \ |_/
/ __ / - _ ___
/ / / / / /
_ _ _ _/ / / \_/ \_ ______
___________\___\__________________
"
for initscript in /etc/init.d/S[0-9][0-9]*
do
if [ -x $initscript ] ;
then
echo "[RCS]: $initscript"
$initscript
fi
done

90
etc/inittab Normal file
View File

@ -0,0 +1,90 @@
# /etc/inittab init(8) configuration for BusyBox
#
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# <id>: WARNING: This field has a non-traditional meaning for BusyBox init!
#
# The id field is used by BusyBox init to specify the controlling tty for
# the specified process to run on. The contents of this field are
# appended to "/dev/" and used as-is. There is no need for this field to
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
# containing non-empty id fields will _not_ be run. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# <runlevels>: The runlevels field is completely ignored.
#
# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
#
# Note: unrecognised actions (like initdefault) will cause init to emit
# an error message, and then go along with its business.
#
# <process>: Specifies the process to be executed and it's command line.
#
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
# ::sysinit:/etc/init.d/rcS
# ::askfirst:/bin/sh
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/sbin/swapoff -a
# ::shutdown:/bin/umount -a -r
# ::restart:/sbin/init
#
# if it detects that /dev/console is _not_ a serial console, it will
# also run:
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
#
# Boot-time system configuration/initialization script.
# This is run first except when booting in single-user mode.
#
::sysinit:/etc/init.d/rcS
# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell. Normally this is handled by
# login, but since we are bypassing login in this case, BusyBox lets you do
# this yourself...
#
# Start an "askfirst" shell on the console (whatever that may be)
#::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
# tty2::askfirst:-/bin/sh
# tty3::askfirst:-/bin/sh
# tty4::askfirst:-/bin/sh
# /sbin/getty invocations for selected ttys
# tty4::respawn:/sbin/getty 38400 tty5
# tty5::respawn:/sbin/getty 38400 tty6
# Example of how to put a getty on a serial line (for a terminal)
::respawn:/sbin/getty -L ttyS000 115200 vt100 -n root -I "Auto login as root ..."
#::respawn:/sbin/getty -L ttyS1 9600 vt100
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

1
etc/ipcamera/TZ Normal file
View File

@ -0,0 +1 @@
STD+06:00

2
etc/ipcamera/board.conf Normal file
View File

@ -0,0 +1,2 @@
boardtype=723000

76
etc/ipcamera/boottab Normal file
View File

@ -0,0 +1,76 @@
#!/bin/sh
ulimit -s 256
. /etc/sysenv.conf
export PATH="/rtbin:/usr/bin:/usr/sbin:/bin:/sbin:/bin/vs/cgi-bin:/bin/vs:/usr/local/sbin:/usr/local/bin:/rt/bin:/tmpfs"
export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib:/lib:/rt/lib"
####设置默认开机时间
date -s "2020-01-01 08:00:00"
. ${BOARD_CONF}
BoardType=$boardtype
echo "=== start run boottab ==="
cd /komod && ./load AUTO
echo "start_up" > /proc/rt/led
if [ -x /bin/vslocal/autostartup.sh ];then
/bin/vslocal/autostartup.sh
fi
#start syslogd
syslogd -m 0 -O /tmpfs/syslog.txt -S -s 100 -b 0 &
#log when start
LOGINFO="`date` BOOTTAB: System Start!"
echo "$LOGINFO" >> /tmpfs/syslog.txt
/bin/vs/sysmon.sh &
if [ -x /bin/vs/cgi-bin/net_serv.sh ];then
/bin/vs/cgi-bin/net_serv.sh &
fi
#add hostname
hostname RT-IPC
#start the program of app
cd /bin/vs
logger -t vs "ipcvs_server start !"
file="/bin/vslocal/ipcam"
restartcnt=0
. ${SENSOR_CONF}
SensorType=$sensortype
while [ 1 ]
do
if [ -e "$file" ]
then
./ipcam -sensortype ${SensorType} -boardtype ${BoardType} -restartcnt ${restartcnt}
if [ -e /tmpfs/ipcam.pid ]
then
sleep 10
exit 1
else
restartcnt=`expr $restartcnt + 1`
echo $restartcnt restart
if [ ${restartcnt} -ge 3 ];then
###超过3次都启动失败刷除config分区
config_mtd="/dev/mtd4"
flash_eraseall ${config_mtd}
flashcp /bin/vslocal/config.bin ${config_mtd}
reboot
fi
fi
else
exit 1
fi
done

44
etc/ipcamera/led.ini Normal file
View File

@ -0,0 +1,44 @@
;boardtype 驱动用版型(硬件),不需要与固件的板子型号一样
[boardtype]
boardtype=723000;
;action_x: x为灯号 根据不同版型确定为红或蓝
;action:on,off,quick,slow
;level_x: 1-x 优先级值越大优先级越高默认为优先级0
;time:动作持续时间默认永久。时间到了会恢复到上个状态单位是100ms
;注意下面任何一个动作属性都要带ledno,不然会解析出错
;ledno 1:红灯2:蓝灯
[event]
;开机两灯长亮
start_up=action_1:off,action_2:off
;AP模式蓝灯慢闪
ap_mode=action_2:slow
;STA模式红灯常亮
sta_mode=action_2:on
;联网中,红灯快闪
wifi_connecting=action_2:quick
;联网成功,红灯常亮
wifi_connected=action_2:on
;联网失败,红灯快闪
wifi_connect_error=action_2:quick
;开始复位,红蓝快闪
reset_begin=action_1:quick,action_2:quick,level_1:1,level_2:1
;复位完成,红蓝灯灭
reset_end=action_1:off,action_2:off,level_1:1,level_2:1
;升级中,红蓝灯慢闪
upgrade_begin=action_1:quick,action_2:quick
;升级完成,红蓝灯快闪
upgrade_end=action_1:quick,action_2:quick
;录像中,蓝灯慢闪
recing=action_1:on
;不录像,蓝灯长亮
rec_end=action_1:on
;无SD卡或者SD卡损坏
sdcard_error=action_1:slow
;循环录像红灯亮起亮起一秒熄灭
normal_rec=action_1:on,time_1:8,action_2:off,level_2:1,level_1:1
;人形检测或者移动侦测蓝灯亮起一秒熄灭
alarm_rec=action_2:on,time_2:8,action_1:off,level_2:1,level_1:1
;关闭所有灯
led_all_off=action_1:off,action_2:off,level_1:1,level_2:1

View File

@ -0,0 +1,9 @@
interface=ra0
ctrl_interface=/var/run/hostapd
driver=nl80211
ssid=RuntopAP
hw_mode=g
channel=2
beacon_int=100
dtim_period=2
max_num_sta=3

View File

@ -0,0 +1,10 @@
### priflag, 指当有2个网卡时, 以哪个网卡为高优先级
priflag=1
#iface=
dhcp=y
dnstype=server
address=192.168.0.136
netmask=255.255.255.0
gateway=192.168.0.1
#mac=00:19:20:18:01:36
mac=

View File

@ -0,0 +1,3 @@
auto eth0 eth2
iface eth0 inet dhcp
iface eth2 inet dhcp

View File

@ -0,0 +1,2 @@
eth0 wifi

View File

@ -0,0 +1,3 @@
##lined 没有有线网络
#networkmedia_lined=YES 默认
networkmedia_lined=NO

View File

@ -0,0 +1,3 @@
domain lan
nameserver 192.168.1.1
nameserver 8.8.8.8

View File

@ -0,0 +1,104 @@
#!/bin/sh
show_info()
{
echo -e "\033[32m $1 \033[0m" >&2
}
show_info1()
{
echo -e "\033[35m $1 \033[0m" >&2
}
show_error()
{
echo -e "\033[41;37m $1 \033[0m" >&2
}
if [ -z $1 ]
then
echo "wifikeytype cannot null"
return
fi
if [ -z $2 ]
then
echo "SSID cannot null"
return
fi
fixnet_config_tmp=fixnet.conf
wifiessid=$1
wifikeytype=$2
wifikey=$3
wifiwhichkey=0
show_info "gen wpa ssid:$wifiessid,keytype:$wifikeytype,keyidx:$wifiwhichkey,key:$wifikey"
echo "ctrl_interface=/var/run/wpa_supplicant" > $fixnet_config_tmp
echo "ap_scan=1" >> $fixnet_config_tmp
echo "update_config=1" >> $fixnet_config_tmp
#wifikeytype define in file $wifi_config
#wifikeytype =1: no key
#wifikeytype =2: wep
#wifikeytype =3:wpa
if [ $wifikeytype = 1 ]
then
echo "network={" >> $fixnet_config_tmp
echo "ssid=\"${wifiessid}\" " >> $fixnet_config_tmp
echo "key_mgmt=NONE" >> $fixnet_config_tmp
echo "}" >> $fixnet_config_tmp
elif [ $wifikeytype = 2 ]
then
echo "network={" >> $fixnet_config_tmp
echo "ssid=\"${wifiessid}\" " >> $fixnet_config_tmp
wifikeylen=`expr length "$wifikey"`
show_info wifikey $wifikey wifikeylen is $wifikeylen
if [ $wifikeylen -eq 5 ] || [ $wifikeylen -eq 13 ] || [ $wifikeylen -eq 16 ]
then
##字符
show_info "wepkey char"
echo "wep_key${wifiwhichkey}=\"${wifikey}\"" >> $fixnet_config_tmp
elif [ $wifikeylen -eq 10 ] || [ $wifikeylen -eq 26 ] || [ $wifikeylen -eq 32 ]
then
show_info "wepkey hex"
echo "wep_key${wifiwhichkey}=${wifikey}" >> $fixnet_config_tmp
else
show_info "wepkey err"
fi
####echo "wep_key${wifiwhichkey}=${wifikey}" >> $fixnet_config_tmp
echo "key_mgmt=NONE" >> $fixnet_config_tmp
echo "wep_tx_keyidx=${wifiwhichkey}" >> $fixnet_config_tmp
echo "auth_alg=SHARED" >> $fixnet_config_tmp
echo " }" >> $fixnet_config_tmp
elif [ $wifikeytype = 3 ]
then
if [ x"$wifikey" = x ]
then
echo "ERROR. WifiKey is null"
wifikey="12345678"
fi
wifikeylen=`expr length "$wifikey"`
echo wifikey is $wifikey wifikeylen is $wifikeylen
if [ $wifikeylen -lt 8 ]
then
echo "ERROR. Wifikey length must large than 8"
wifikey="12345678"
fi
wpa_passphrase "$wifiessid" "$wifikey" >> $fixnet_config_tmp
fi
#for hide ssid
networkline=`cat $fixnet_config_tmp | grep "network={" -n | awk -F ":" '{print $1}'`
if [ -n "$networkline" ];then
networkline=`expr $networkline + 1`
sed -i "$networkline s/^/\tscan_ssid=1\n/" $fixnet_config_tmp
fi

View File

@ -0,0 +1,27 @@
wifidev="ra0"
export wifidev
drvload="/komod/wifiko.sh load"
drvunload="/komod/wifiko.sh unload"
drvload_ap="/komod/wifiapko.sh load"
drvunload_ap="/komod/wifiapko.sh unload"
######## below modify by cgi #############
# enable default 0,
# if not set enable, it is disable
# enable 0 -- disable wifi
# enable 1 -- enable wifi,
# when lined not plug in , startup with wifi, else start with lined
# in running state , if plug line, enable lined network
# unplug lined, start with wifi
# enable 2 -- enable wifi ,
# when lined not plugin, startup with wifi, else start with lined
# in running state, if plug line, donn't enable lined network, still run wifi
wifidev="ra0"
wifienable="1"
wifiessid="62616e616e616d616e"
wifikeytype=3
wifiwhichkey=0
wifikey="6d6a66336937666432676a6a3633"

View File

@ -0,0 +1,30 @@
#!/bin/sh
### AP前缀
#ap_prefix=
### ap_postfix, 后缀方法, p2p_id, 或者 是mac, 与前缀之间, 用-连接
#ap_postfix=P2P_ID
### 取 ap_postfix 的最后几位
#ap_postfix_lastsn=12
### AP固定名字, 当配置了这个, 固定这个名字
#ap_name=IPCAM-AP:
### STA连接不上, 是否自动进入AP
#ap_auto=1
### AP 模式下, 配置后的动作 : NONE:无动作, STA:切换到STA, 用新配置的连接, REBOOT:重启
#ap_sta_after_config=
###########################################
ap_prefix=CamDog
###该值未使用
ap_postfix=P2P_ID
###该值未使用
ap_postfix_lastsn=12
ap_name=
ap_auto=0
ap_after_config=STA
sta_failed_after=AP
smtcn_auto=0
fatcn_auto=0
###加密
auth_mode=WPA2PSK
wpa_psk=camdog66

View File

@ -0,0 +1,21 @@
wifidev="ra0"
export wifidev
drvload="/komod/wifiko.sh load"
drvunload="/komod/wifiko.sh unload"
drvload_ap="/komod/wifiapko.sh load"
drvunload_ap="/komod/wifiapko.sh unload"
######## below modify by cgi #############
# enable default 0,
# if not set enable, it is disable
# enable 0 -- disable wifi
# enable 1 -- enable wifi,
# when lined not plug in , startup with wifi, else start with lined
# in running state , if plug line, enable lined network
# unplug lined, start with wifi
# enable 2 -- enable wifi ,
# when lined not plugin, startup with wifi, else start with lined
# in running state, if plug line, donn't enable lined network, still run wifi

View File

@ -0,0 +1,10 @@
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
update_config=1
network={
scan_ssid=1
#byRTtool=62616e616e616d616e
ssid=62616e616e616d616e
psk="[WIFI PASSWORD CENSORED]"
#psk="6d6a66336937666432676a6a3633"
}

View File

@ -0,0 +1,38 @@
#!/bin/sh
# only for use as a "zcip" callback script
if [ "x$interface" = x ]
then
exit 1
fi
# zcip should start on boot/resume and various media changes
case "$1" in
init)
# for now, zcip requires the link to be already up,
# and it drops links when they go down. that isn't
# the most robust model...
exit 0
;;
config)
if [ "x$ip" = x ]
then
exit 1
fi
# remember $ip for $interface, to use on restart
if [ "x$IP" != x -a -w "$IP.$interface" ]
then
echo $ip > "$IP.$interface"
fi
exec ip address add dev $interface \
scope link local "$ip/16" broadcast +
;;
deconfig)
if [ x$ip = x ]
then
exit 1
fi
exec ip address del dev $interface local $ip
;;
esac
exit 1

1
etc/ipcamera/passwd Normal file
View File

@ -0,0 +1 @@
root:7wtxBdUGBnuoY:0:0::/root:/bin/sh

1
etc/ipcamera/sensor.conf Normal file
View File

@ -0,0 +1 @@
sensortype=soih62

91
etc/ipcamera/udhcpd.conf Normal file
View File

@ -0,0 +1,91 @@
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# Values shown are defaults
# The start and end of the IP lease block
start 192.168.234.20
end 192.168.234.254
# The interface that udhcpd will use
interface ra0
# The maximim number of leases (includes addresses reserved
# by OFFER's, DECLINE's, and ARP conficts). Will be corrected
# if it's bigger than IP lease block, but it ok to make it
# smaller than lease block.
#max_leases 254
# The time period at which udhcpd will write out a dhcpd.leases
# file. If this is 0, udhcpd will never automatically write a
# lease file. Specified in seconds.
#auto_time 7200
# The amount of time that an IP will be reserved (leased to nobody)
# if a DHCP decline message is received (seconds).
#decline_time 3600
# The amount of time that an IP will be reserved
# if an ARP conflct occurs (seconds).
#conflict_time 3600
# How long an offered address is reserved (seconds).
#offer_time 60
# If client asks for lease below this value, it will be rounded up
# to this value (seconds).
#min_lease 60
# The location of the leases file
lease_file /etc/ipcamera/udhcpd.leases
# The location of the pid file
#pidfile /var/run/udhcpd.pid
# Everytime udhcpd writes a leases file, the below script will be called.
#notify_file # default: no script
#notify_file dumpleases # useful for debugging
# The following are bootp specific options, settable by udhcpd.
#siaddr 192.168.0.22 #default: 0.0.0.0
#sname zorak #default: none
#boot_file /var/nfs_root #default: none
# The remainer of options are DHCP options and can be specifed with the
# keyword 'opt' or 'option'. If an option can take multiple items, such
# as the dns option, they can be listed on the same line, or multiple
# lines. The only option with a default is 'lease'.
# Examples:
#opt dns 192.168.10.2 192.168.10.10
opt dns 192.168.234.1
option subnet 255.255.255.0
opt router 192.168.234.1
#opt wins 192.168.10.10
#option dns 129.219.13.81 # appened to above DNS servers for a total of 3
#option domain local
option lease 864000 # 10 days of seconds
# Currently supported options (for more info, see options.c):
#opt subnet
#opt timezone
#opt router
#opt timesrv
#opt namesrv
#opt dns
#opt logsrv
#opt cookiesrv
#opt lprsrv
#opt bootsize
#opt domain
#opt swapsrv
#opt rootpath
#opt ipttl
#opt mtu
#opt broadcast
#opt wins
#opt lease
#opt ntpsrv
#opt tftp
#opt bootfile
# Static leases map
#static_lease 00:60:08:11:CE:4E 192.168.0.54
#static_lease 00:60:08:11:CE:3E 192.168.0.44

BIN
etc/ipcamera/udhcpd.leases Normal file

Binary file not shown.

35
etc/mdev.conf Normal file
View File

@ -0,0 +1,35 @@
# null may already exist; therefore ownership has to be changed with command
null root:root 666 @chmod 666 $MDEV
zero root:root 666
full root:root 666
random root:root 444
urandom root:root 444
hwrandom root:root 444
grsec root:root 660
kmem root:root 640
mem root:root 640
port root:root 640
# console may already exist; therefore ownership has to be changed with command
console root:tty 600 @chmod 600 $MDEV
ptmx root:tty 666
pty.* root:tty 660
# Typical devices
tty root:tty 666
tty[0-9]* root:tty 660
vcsa*[0-9]* root:tty 660
ttyS[0-9]* root:root 660
# alsa sound devices
pcm.* root:audio 660 =snd/
control.* root:audio 660 =snd/
midi.* root:audio 660 =snd/
seq root:audio 660 =snd/
timer root:audio 660 =snd/
# input stuff
event[0-9]+ root:root 640 =input/
mice root:root 640 =input/
mouse[0-9] root:root 640 =input/
ts[0-9] root:root 600 =input/

4
etc/mtab Normal file
View File

@ -0,0 +1,4 @@
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devfs /dev devfs rw 0 0
devpts /dev/pts devpts rw 0 0

1
etc/network Symbolic link
View File

@ -0,0 +1 @@
ipcamera/network/

1
etc/passwd Symbolic link
View File

@ -0,0 +1 @@
ipcamera/passwd

1
etc/passwd- Normal file
View File

@ -0,0 +1 @@
root:ab8nBoH3mb8.g:0:0::/root:/bin/sh

43
etc/profile Normal file
View File

@ -0,0 +1,43 @@
# ~/.bashrc: executed by bash(1) for non-login interactive shells.
export PATH="/rtbin:/usr/bin:/usr/sbin:/bin:/sbin:/bin/vs/cgi-bin:/bin/vs:/usr/local/sbin:/usr/local/bin:/rt/bin:/tmpfs"
export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib:/lib:/rt/lib"
# If running interactively, then:
if [ "$PS1" ]; then
if [ "$BASH" ]; then
export PS1="[\u@\h \W]\\$ "
alias ll='/bin/ls --color=tty -laFh'
alias ls='/bin/ls --color=tty -F'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
else
export PS1='# '
fi
#export USER=`id -un`
export USER=root
export LOGNAME=$USER
export HOSTNAME=`/bin/hostname`
export HISTSIZE=1000
export HISTFILESIZE=1000
export PAGER='/bin/more '
export EDITOR='/bin/vi'
export INPUTRC=/etc/inputrc
export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
### Some aliases
fi;
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
umask 022
export TERM=vt100
echo "${GREEN}Welcome to HiLinux.${NORMAL}"

31
etc/protocols Normal file
View File

@ -0,0 +1,31 @@
# /etc/protocols:
# $Id: protocols,v 1.1 2004/10/09 02:49:18 andersen Exp $
#
# Internet (IP) protocols
#
# from: @(#)protocols 5.1 (Berkeley) 4/17/89
#
# Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).
ip 0 IP # internet protocol, pseudo protocol number
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # Internet Group Management
ggp 3 GGP # gateway-gateway protocol
ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
st 5 ST # ST datagram mode
tcp 6 TCP # transmission control protocol
egp 8 EGP # exterior gateway protocol
pup 12 PUP # PARC universal packet protocol
udp 17 UDP # user datagram protocol
hmp 20 HMP # host monitoring protocol
xns-idp 22 XNS-IDP # Xerox NS IDP
rdp 27 RDP # "reliable datagram" protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4
xtp 36 XTP # Xpress Tranfer Protocol
ddp 37 DDP # Datagram Delivery Protocol
idpr-cmtp 39 IDPR-CMTP # IDPR Control Message Transport
rspf 73 RSPF #Radio Shortest Path First.
vmtp 81 VMTP # Versatile Message Transport
ospf 89 OSPFIGP # Open Shortest Path First IGP
ipip 94 IPIP # Yet Another IP encapsulation
encap 98 ENCAP # Yet Another IP encapsulation

1
etc/resolv.conf Symbolic link
View File

@ -0,0 +1 @@
network/resolv.conf

1
etc/sensor.conf Symbolic link
View File

@ -0,0 +1 @@
ipcamera/sensor.conf

485
etc/services Normal file
View File

@ -0,0 +1,485 @@
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, officially ports have two entries
# even if the protocol doesn't support UDP operations.
#
# Updated from http://www.iana.org/assignments/port-numbers and other
# sources like http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services .
# New ports will be added on request if they have been officially assigned
# by IANA or are needed by a debian package.
# If you need a huge list of used numbers please install the nmap package.
tcpmux 1/tcp # TCP port service multiplexer
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
daytime 13/tcp
daytime 13/udp
netstat 15/tcp
qotd 17/tcp quote
msp 18/tcp # message send protocol
msp 18/udp
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp-data 20/tcp
ftp 21/tcp
fsp 21/udp fspd
ssh 22/tcp # SSH Remote Login Protocol
ssh 22/udp
telnet 23/tcp
smtp 25/tcp mail
time 37/tcp timserver
time 37/udp timserver
rlp 39/udp resource # resource location
nameserver 42/tcp name # IEN 116
whois 43/tcp nicname
tacacs 49/tcp # Login Host Protocol (TACACS)
tacacs 49/udp
re-mail-ck 50/tcp # Remote Mail Checking Protocol
re-mail-ck 50/udp
domain 53/tcp nameserver # name-domain server
domain 53/udp nameserver
mtp 57/tcp # deprecated
bootps 67/tcp # BOOTP server
bootps 67/udp
tacacs-ds 65/tcp # TACACS-Database Service
tacacs-ds 65/udp
bootpc 68/tcp # BOOTP client
bootpc 68/udp
tftp 69/udp
gopher 70/tcp # Internet Gopher
gopher 70/udp
rje 77/tcp netrjs
finger 79/tcp
www 80/tcp http # WorldWideWeb HTTP
www 80/udp # HyperText Transfer Protocol
link 87/tcp ttylink
kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5
kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5
supdup 95/tcp
hostnames 101/tcp hostname # usually from sri-nic
iso-tsap 102/tcp tsap # part of ISODE
csnet-ns 105/tcp cso-ns # also used by CSO name server
csnet-ns 105/udp cso-ns
rtelnet 107/tcp # Remote Telnet
rtelnet 107/udp
pop2 109/tcp postoffice pop-2 # POP version 2
pop2 109/udp pop-2
pop3 110/tcp pop-3 # POP version 3
pop3 110/udp pop-3
sunrpc 111/tcp portmapper # RPC 4.0 portmapper
sunrpc 111/udp portmapper
auth 113/tcp authentication tap ident
sftp 115/tcp
uucp-path 117/tcp
nntp 119/tcp readnews untp # USENET News Transfer Protocol
ntp 123/tcp
ntp 123/udp # Network Time Protocol
pwdgen 129/tcp # PWDGEN service
pwdgen 129/udp # PWDGEN service
loc-srv 135/tcp epmap # Location Service
loc-srv 135/udp epmap
netbios-ns 137/tcp # NETBIOS Name Service
netbios-ns 137/udp
netbios-dgm 138/tcp # NETBIOS Datagram Service
netbios-dgm 138/udp
netbios-ssn 139/tcp # NETBIOS session service
netbios-ssn 139/udp
imap2 143/tcp imap # Interim Mail Access P 2 and 4
imap2 143/udp imap
snmp 161/udp # Simple Net Mgmt Proto
snmp-trap 162/udp snmptrap # Traps for SNMP
cmip-man 163/tcp # ISO mgmt over IP (CMOT)
cmip-man 163/udp
cmip-agent 164/tcp
cmip-agent 164/udp
mailq 174/tcp # Mailer transport queue for Zmailer
mailq 174/udp # Mailer transport queue for Zmailer
xdmcp 177/tcp # X Display Mgr. Control Proto
xdmcp 177/udp
nextstep 178/tcp NeXTStep NextStep # NeXTStep window
nextstep 178/udp NeXTStep NextStep # server
bgp 179/tcp # Border Gateway Protocol
bgp 179/udp
prospero 191/tcp # Cliff Neuman's Prospero
prospero 191/udp
irc 194/tcp # Internet Relay Chat
irc 194/udp
smux 199/tcp # SNMP Unix Multiplexer
smux 199/udp
at-rtmp 201/tcp # AppleTalk routing
at-rtmp 201/udp
at-nbp 202/tcp # AppleTalk name binding
at-nbp 202/udp
at-echo 204/tcp # AppleTalk echo
at-echo 204/udp
at-zis 206/tcp # AppleTalk zone information
at-zis 206/udp
qmtp 209/tcp # Quick Mail Transfer Protocol
qmtp 209/udp # Quick Mail Transfer Protocol
z3950 210/tcp wais # NISO Z39.50 database
z3950 210/udp wais
ipx 213/tcp # IPX
ipx 213/udp
imap3 220/tcp # Interactive Mail Access
imap3 220/udp # Protocol v3
pawserv 345/tcp # Perf Analysis Workbench
pawserv 345/udp
zserv 346/tcp # Zebra server
zserv 346/udp
fatserv 347/tcp # Fatmen Server
fatserv 347/udp
rpc2portmap 369/tcp
rpc2portmap 369/udp # Coda portmapper
codaauth2 370/tcp
codaauth2 370/udp # Coda authentication server
clearcase 371/tcp Clearcase
clearcase 371/udp Clearcase
ulistserv 372/tcp # UNIX Listserv
ulistserv 372/udp
ldap 389/tcp # Lightweight Directory Access Protocol
ldap 389/udp
https 443/tcp # http protocol over TLS/SSL
https 443/udp
snpp 444/tcp # Simple Network Paging Protocol
snpp 444/udp
microsoft-ds 445/tcp # Microsoft Naked CIFS
microsoft-ds 445/udp
saft 487/tcp # Simple Asynchronous File Transfer
saft 487/udp
isakmp 500/tcp # IPsec - Internet Security Association
isakmp 500/udp # and Key Management Protocol
npmp-local 610/tcp dqs313_qmaster # npmp-local / DQS
npmp-local 610/udp dqs313_qmaster
npmp-gui 611/tcp dqs313_execd # npmp-gui / DQS
npmp-gui 611/udp dqs313_execd
hmmp-ind 612/tcp dqs313_intercell # HMMP Indication / DQS
hmmp-ind 612/udp dqs313_intercell
ipp 631/tcp # Internet Printing Protocol
ipp 631/udp
#
# UNIX specific services
#
exec 512/tcp
biff 512/udp comsat
login 513/tcp
who 513/udp whod
shell 514/tcp cmd # no passwords used
syslog 514/udp
printer 515/tcp spooler # line printer spooler
talk 517/udp
ntalk 518/udp
route 520/udp router routed # RIP
timed 525/udp timeserver
tempo 526/tcp newdate
courier 530/tcp rpc
conference 531/tcp chat
netnews 532/tcp readnews
netwall 533/udp # for emergency broadcasts
gdomap 538/tcp # GNUstep distributed objects
gdomap 538/udp
uucp 540/tcp uucpd # uucp daemon
klogin 543/tcp # Kerberized `rlogin' (v5)
kshell 544/tcp krcmd # Kerberized `rsh' (v5)
afpovertcp 548/tcp # AFP over TCP
afpovertcp 548/udp
remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem
nntps 563/tcp snntp # NNTP over SSL
nntps 563/udp snntp
submission 587/tcp # Submission [RFC2487]
submission 587/udp
ldaps 636/tcp # LDAP over SSL
ldaps 636/udp
tinc 655/tcp # tinc control port
tinc 655/udp
silc 706/tcp
silc 706/udp
kerberos-adm 749/tcp # Kerberos `kadmin' (v5)
#
webster 765/tcp # Network dictionary
webster 765/udp
rsync 873/tcp
rsync 873/udp
ftps-data 989/tcp # FTP over SSL (data)
ftps 990/tcp
telnets 992/tcp # Telnet over SSL
telnets 992/udp
imaps 993/tcp # IMAP over SSL
imaps 993/udp
ircs 994/tcp # IRC over SSL
ircs 994/udp
pop3s 995/tcp # POP-3 over SSL
pop3s 995/udp
#
# From ``Assigned Numbers'':
#
#> The Registered Ports are not controlled by the IANA and on most systems
#> can be used by ordinary user processes or programs executed by ordinary
#> users.
#
#> Ports are used in the TCP [45,106] to name the ends of logical
#> connections which carry long term conversations. For the purpose of
#> providing services to unknown callers, a service contact port is
#> defined. This list specifies the port used by the server process as its
#> contact port. While the IANA can not control uses of these ports it
#> does register or list uses of these ports as a convienence to the
#> community.
#
socks 1080/tcp # socks proxy server
socks 1080/udp
kazaa 1214/tcp
kazaa 1214/udp
nessus 1241/tcp # Nessus vulnerability
nessus 1241/udp # assessment scanner
lotusnote 1352/tcp lotusnotes # Lotus Note
lotusnote 1352/udp lotusnotes
ms-sql-s 1433/tcp # Microsoft SQL Server
ms-sql-s 1433/udp
ms-sql-m 1434/tcp # Microsoft SQL Monitor
ms-sql-m 1434/udp
ingreslock 1524/tcp
ingreslock 1524/udp
prospero-np 1525/tcp # Prospero non-privileged
prospero-np 1525/udp
datametrics 1645/tcp old-radius
datametrics 1645/udp old-radius
sa-msg-port 1646/tcp old-radacct
sa-msg-port 1646/udp old-radacct
kermit 1649/tcp
kermit 1649/udp
radius 1812/tcp
radius 1812/udp
radius-acct 1813/tcp radacct # Radius Accounting
radius-acct 1813/udp radacct
unix-status 1957/tcp # remstats unix-status server
log-server 1958/tcp # remstats log server
remoteping 1959/tcp # remstats remoteping server
rtcm-sc104 2101/tcp # RTCM SC-104 IANA 1/29/99
rtcm-sc104 2101/udp
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp
venus 2430/tcp # codacon port
venus 2430/udp # Venus callback/wbc interface
venus-se 2431/tcp # tcp side effects
venus-se 2431/udp # udp sftp side effect
codasrv 2432/tcp # not used
codasrv 2432/udp # server port
codasrv-se 2433/tcp # tcp side effects
codasrv-se 2433/udp # udp sftp side effect
mon 2583/tcp # MON
mon 2583/udp
dict 2628/tcp # Dictionary server
dict 2628/udp
gds_db 3050/tcp # InterBase server
gds_db 3050/udp
icpv2 3130/tcp icp # Internet Cache Protocol
icpv2 3130/udp icp
mysql 3306/tcp
mysql 3306/udp
nut 3493/tcp # Network UPS Tools
nut 3493/udp
distcc 3632/tcp # distributed compiler
distcc 3632/udp
svnserve 3690/tcp svn subversion # Subversion protocol
svnserve 3690/udp svn subversion
radmin-port 4899/tcp # RAdmin Port
radmin-port 4899/udp
rfe 5002/udp # Radio Free Ethernet
rfe 5002/tcp
jabber-client 5222/tcp # Jabber Client Connection
jabber-client 5222/udp
jabber-server 5269/tcp # Jabber Server Connection
jabber-server 5269/udp
cfengine 5308/tcp
cfengine 5308/udp
postgresql 5432/tcp postgres # PostgreSQL Database
postgresql 5432/udp postgres
x11 6000/tcp x11-0 # X Window System
x11 6000/udp x11-0
x11-1 6001/tcp
x11-1 6001/udp
x11-2 6002/tcp
x11-2 6002/udp
x11-3 6003/tcp
x11-3 6003/udp
x11-4 6004/tcp
x11-4 6004/udp
x11-5 6005/tcp
x11-5 6005/udp
x11-6 6006/tcp
x11-6 6006/udp
x11-7 6007/tcp
x11-7 6007/udp
gnutella-svc 6346/tcp # gnutella
gnutella-svc 6346/udp
gnutella-rtr 6347/tcp # gnutella
gnutella-rtr 6347/udp
afs3-fileserver 7000/tcp bbs # file server itself
afs3-fileserver 7000/udp bbs
afs3-callback 7001/tcp # callbacks to cache managers
afs3-callback 7001/udp
afs3-prserver 7002/tcp # users & groups database
afs3-prserver 7002/udp
afs3-vlserver 7003/tcp # volume location database
afs3-vlserver 7003/udp
afs3-kaserver 7004/tcp # AFS/Kerberos authentication
afs3-kaserver 7004/udp
afs3-volser 7005/tcp # volume managment server
afs3-volser 7005/udp
afs3-errors 7006/tcp # error interpretation service
afs3-errors 7006/udp
afs3-bos 7007/tcp # basic overseer process
afs3-bos 7007/udp
afs3-update 7008/tcp # server-to-server updater
afs3-update 7008/udp
afs3-rmtsys 7009/tcp # remote cache manager service
afs3-rmtsys 7009/udp
font-service 7100/tcp xfs # X Font Service
font-service 7100/udp xfs
bacula-dir 9101/tcp # Bacula Director
bacula-dir 9101/udp
bacula-fd 9102/tcp # Bacula File Daemon
bacula-fd 9102/udp
bacula-sd 9103/tcp # Bacula Storage Daemon
bacula-sd 9103/udp
wnn6 22273/tcp # wnn6
wnn6 22273/udp
#
# Datagram Delivery Protocol services
#
rtmp 1/ddp # Routing Table Maintenance Protocol
nbp 2/ddp # Name Binding Protocol
echo 4/ddp # AppleTalk Echo Protocol
zip 6/ddp # Zone Information Protocol
#=========================================================================
# The remaining port numbers are not as allocated by IANA.
#=========================================================================
# Kerberos (Project Athena/MIT) services
# Note that these are for Kerberos v4, and are unofficial. Sites running
# v4 should uncomment these and comment out the v5 entries above.
#
kerberos4 750/udp kerberos-iv kdc # Kerberos (server)
kerberos4 750/tcp kerberos-iv kdc
kerberos_master 751/udp # Kerberos authentication
kerberos_master 751/tcp
passwd_server 752/udp # Kerberos passwd server
krb_prop 754/tcp krb5_prop hprop # Kerberos slave propagation
krbupdate 760/tcp kreg # Kerberos registration
kpasswd 761/tcp kpwd # Kerberos "passwd"
swat 901/tcp # swat
kpop 1109/tcp # Pop with Kerberos
knetd 2053/tcp # Kerberos de-multiplexor
zephyr-srv 2102/udp # Zephyr server
zephyr-clt 2103/udp # Zephyr serv-hm connection
zephyr-hm 2104/udp # Zephyr hostmanager
eklogin 2105/tcp # Kerberos encrypted rlogin
# Hmmm. Are we using Kv4 or Kv5 now? Worrying.
# The following is probably Kerberos v5 --- ajt@debian.org (11/02/2000)
kx 2111/tcp # X over Kerberos
iprop 2121/tcp # incremental propagation
#
# Unofficial but necessary (for NetBSD) services
#
supfilesrv 871/tcp # SUP server
supfiledbg 1127/tcp # SUP debugging
#
# Services added for the Debian GNU/Linux distribution
#
linuxconf 98/tcp # LinuxConf
poppassd 106/tcp # Eudora
poppassd 106/udp
imsp 406/tcp # Interactive Mail Support Protocol
imsp 406/udp
ssmtp 465/tcp smtps # SMTP over SSL
nqs 607/tcp # Network Queuing system
moira_db 775/tcp # Moira database
moira_update 777/tcp # Moira update protocol
moira_ureg 779/udp # Moira user registration
spamd 783/tcp # spamassassin daemon
omirr 808/tcp omirrd # online mirror
omirr 808/udp omirrd
customs 1001/tcp # pmake customs server
customs 1001/udp
rmiregistry 1099/tcp # Java RMI Registry
skkserv 1178/tcp # skk jisho server port
predict 1210/udp # predict -- satellite tracking
rmtcfg 1236/tcp # Gracilis Packeten remote config server
wipld 1300/tcp # Wipl network monitor
xtel 1313/tcp # french minitel
xtelw 1314/tcp # french minitel
support 1529/tcp # GNATS
sieve 2000/tcp # Sieve mail filter daemon
cfinger 2003/tcp # GNU Finger
ndtp 2010/tcp # Network dictionary transfer protocol
frox 2121/tcp # frox: caching ftp proxy
ninstall 2150/tcp # ninstall service
ninstall 2150/udp
zebrasrv 2600/tcp # zebra service
zebra 2601/tcp # zebra vty
ripd 2602/tcp # ripd vty (zebra)
ripngd 2603/tcp # ripngd vty (zebra)
ospfd 2604/tcp # ospfd vty (zebra)
bgpd 2605/tcp # bgpd vty (zebra)
ospf6d 2606/tcp # ospf6d vty (zebra)
afbackup 2988/tcp # Afbackup system
afbackup 2988/udp
afmbackup 2989/tcp # Afmbackup system
afmbackup 2989/udp
xtell 4224/tcp # xtell server
fax 4557/tcp # FAX transmission service (old)
hylafax 4559/tcp # HylaFAX client-server protocol (new)
distmp3 4600/tcp # distmp3host daemon
lrrd 4949/tcp # LRRD
pcrd 5151/tcp # PCR-1000 Daemon
noclog 5354/tcp # noclogd with TCP (nocol)
noclog 5354/udp # noclogd with UDP (nocol)
hostmon 5355/tcp # hostmon uses TCP (nocol)
hostmon 5355/udp # hostmon uses UDP (nocol)
rplay 5555/udp # RPlay audio service
rplay 5555/tcp
rptp 5556/udp # Remote Play Transfer Protocol
rptp 5556/tcp
mrtd 5674/tcp # MRT Routing Daemon
bgpsim 5675/tcp # MRT Routing Simulator
canna 5680/tcp # cannaserver
sane 6566/tcp saned # SANE network scanner daemon
ircd 6667/tcp # Internet Relay Chat
zope-ftp 8021/tcp # zope management by ftp
webcache 8080/tcp # WWW caching service
tproxy 8081/tcp # Transparent Proxy
omniorb 8088/tcp # OmniORB
omniorb 8088/udp
mandelspawn 9359/udp mandelbrot # network mandelbrot
zope 9673/tcp # zope server
amanda 10080/udp # amanda backup services
kamanda 10081/tcp # amanda backup services (Kerberos)
kamanda 10081/udp
amandaidx 10082/tcp # amanda backup services
amidxtape 10083/tcp # amanda backup services
smsqp 11201/tcp # Alamin SMS gateway
smsqp 11201/udp
xpilot 15345/tcp # XPilot Contact Port
xpilot 15345/udp
sgi-cmsd 17001/udp # Cluster membership services daemon
sgi-crsd 17002/udp
sgi-gcd 17003/udp # SGI Group membership daemon
sgi-cad 17004/tcp # Cluster Admin daemon
isdnlog 20011/tcp # isdn logging system
isdnlog 20011/udp
vboxd 20012/tcp # voice box system
vboxd 20012/udp
binkp 24554/tcp # binkp fidonet protocol
asp 27374/tcp # Address Search Protocol
asp 27374/udp
dircproxy 57000/tcp # Detachable IRC Proxy
tfido 60177/tcp # fidonet EMSI over telnet
fido 60179/tcp # fidonet EMSI over TCP
# Local services

20
etc/sysctl.conf Normal file
View File

@ -0,0 +1,20 @@
#net.ipv6.conf.all.disable_ipv6 = 1
#net.ipv6.conf.default.disable_ipv6 = 1
#net.ipv6.conf.lo.disable_ipv6 = 1
#vm.dirty_background_ratio = 5
#vm.dirty_background_bytes = 0
#vm.dirty_ratio = 5
#vm.dirty_bytes = 0
#vm.dirty_writeback_centisecs = 100
#vm.dirty_expire_centisecs = 1000
#vm.min_free_kbytes=3000
##vm.drop_caches = 3
##net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_keepalive_time = 20
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_tw_buckets = 60
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_orphan_retries = 4

22
etc/sysenv.conf Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
RT_PATH=/rt
SENSOR_CONF=/etc/sensor.conf
SENSOR_CONF_DEFAULT=/etc/sensor.conf.default
SENSOR_SO=/mnt/config/usr/lib/libSensor.so
BOARD_CONF=/etc/board.conf
boardconffile=/etc/board.conf
sensorconffile=${SENSOR_CONF}
set_mediamem()
{
mediamem=${1}
env_args="mem=${mediamem} "`cat /proc/cmdline | awk '{for(i=2;i<=NF;++i)printf $i" ";}'`
fw_setenv bootargs ${env_args}
}

1
etc/udhcpd.conf Symbolic link
View File

@ -0,0 +1 @@
ipcamera/udhcpd.conf

Some files were not shown because too many files have changed in this diff Show More