fixes for recent errors (#277)

This commit is contained in:
virmaior 2022-08-27 15:17:38 +09:00 committed by GitHub
parent 80ee199cb6
commit 5b90d98ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 11 deletions

View File

@ -13,9 +13,34 @@ echo -e "Content-type: text/html\n\n"
echo ""
die_no_config()
{
if [ -f ${hack_ini} ]
then
if [ -s ${hack_ini} ]
then
echo "$hack_ini exists and not empty"
else
echo "$hack_ini exists but empty"
echo "if you reboot then the hack will fail "
exit
fi
else
echo "$hack_ini file does not exist"
echo "if you reboot then the hack will fail. Please insure you have a wz_hack.conf file.."
exit
fi
}
reboot_camera() {
echo "rebooting camera (refreshing screen in 90 seconds)"
echo '<script type="text/javascript">setTimeout(function(){ document.location.reload (); },90 * 1000)</script>'
die_no_config
reboot_wait=90
echo "rebooting camera (refreshing screen in $reboot_wait seconds)"
echo '<script type="text/javascript">setTimeout(function(){ document.location.href = "/cgi-bin/config.cgi"; },'$reboot_wait' * 1000)</script>'
handle_css config.css
version_info "display_BAR"
reboot
exit
}
@ -197,16 +222,9 @@ function html_cam_feed
function handle_css
{
echo -ne "<style type=\"text/css\">"
cat config.css
echo -ne '</style>';
}
echo -ne "<html><head><title>$title</title>"
handle_css wz_mini_web.css
handle_css config.css
echo '<script type="text/javascript" src="/config.js" ></script>'
echo -ne "</head>"

View File

@ -22,6 +22,15 @@ hackver=$(cat /opt/wz_mini/usr/bin/app.ver)
ipaddr=$(ifconfig wlan0 | grep inet | cut -d ':' -f2 | cut -d ' ' -f0)
macaddr=$(ifconfig wlan0 | grep HWaddr | cut -d 'HW' -f2 | cut -d ' ' -f2)
function handle_css
{
echo -ne "<style type=\"text/css\">"
cat $1
echo -ne '</style>';
}
function version_info
{
echo "<div id='$1'>"

View File

@ -45,7 +45,7 @@ function compose_rtsp_block(stype)
stream = "/unicast";
if ((fdata.get('RTSP_HI_RES_ENABLED') == "true") && (fdata.get('RTSP_LOW_RES_ENABLED') == "true")) {
if (stype == "RTSP_HI") { stream = "/video1_unicast" } else { stream ="/video2_unicast" }
if (stype == "RTSP_HI_RES") { stream = "/video1_unicast" } else { stream ="/video2_unicast" }
}
var link = "rtsp://" + auth + document.body.getAttribute("ip") + ":" + fdata.get('RTSP_PORT') + stream;