diff --git a/SD_ROOT/wz_mini/www/cgi-bin/config.cgi b/SD_ROOT/wz_mini/www/cgi-bin/config.cgi index 260be33..a73a6ed 100644 --- a/SD_ROOT/wz_mini/www/cgi-bin/config.cgi +++ b/SD_ROOT/wz_mini/www/cgi-bin/config.cgi @@ -1,15 +1,13 @@ #!/bin/sh # This serves a rudimentary webpage based on wz_mini.conf -base_dir=/opt/wz_mini/ -base_hack_ini=/opt/wz_mini/wz_mini.conf -hack_ini=$base_hack_ini -www_dir=/opt/wz_mini/www/cgi-bin/ -camver=V3 -camfirmware=$(tail -n1 /configs/app.ver | cut -f2 -d= ) -hackver=$(cat /opt/wz_mini/usr/bin/app.ver) -title="Wyze $camver on $camfirmware running wz_mini $hackver as $HOSTNAME" +. /opt/wz_mini/www/cgi-bin/shared.cgi + +title="$camver on $camfirmware running wz_mini $hackver as $HOSTNAME" updated=false + + + echo "HTTP/1.1 200" echo -e "Content-type: text/html\n\n" echo "" @@ -65,17 +63,6 @@ function revert_menu echo '' } -function version_info -{ - echo "
" +dmesg +echo "" + + +version_info "display_BAR" +echo "" + +echo "" diff --git a/SD_ROOT/wz_mini/www/cgi-bin/jpeg.cgi b/SD_ROOT/wz_mini/www/cgi-bin/jpeg.cgi index 3b6efe8..97246fc 100644 --- a/SD_ROOT/wz_mini/www/cgi-bin/jpeg.cgi +++ b/SD_ROOT/wz_mini/www/cgi-bin/jpeg.cgi @@ -4,7 +4,6 @@ #test for jpeg if [[ $REQUEST_METHOD = 'GET' ]]; then - echo "entered GET" #since ash does not handle arrays we create variables using eval IFS='&' for PAIR in $QUERY_STRING diff --git a/SD_ROOT/wz_mini/www/cgi-bin/shared.cgi b/SD_ROOT/wz_mini/www/cgi-bin/shared.cgi new file mode 100644 index 0000000..8850cee --- /dev/null +++ b/SD_ROOT/wz_mini/www/cgi-bin/shared.cgi @@ -0,0 +1,33 @@ +#!/bin/sh +# This provides shared values for webpages +base_dir=/opt/wz_mini/ +base_hack_ini=/opt/wz_mini/wz_mini.conf +hack_ini=$base_hack_ini +www_dir=/opt/wz_mini/www/cgi-bin/ +camver=V3 + +if [ -f /opt/wz_mini/tmp/.T31 ]; then +camtype=T31 +elif [ -f /opt/wz_mini/tmp/.T20 ]; then +camtype=T20 +fi + +cammodel=$(/opt/wz_mini/etc/init.d/s04model start | grep detected | cut -f1 -d ' ' ) + +camver="$camtype($cammodel)" + +camfirmware=$(tail -n1 /configs/app.ver | cut -f2 -d= ) +hackver=$(cat /opt/wz_mini/usr/bin/app.ver) + + +function version_info +{ + echo "