#!/bin/sh # This serves a rudimentary webpage based on wz_mini.conf . /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 "" reboot_camera() { echo "rebooting camera (refreshing screen in 90 seconds)" echo '' reboot exit } shft() { # SE loop did not work -- thanks ash! suff=8 while [ "$suff" -gt 0 ] ; do if [[ -f "$1.$suff" ]] ; then nxt=$((suff + 1)) mv -f "$1.$suff" "$1.$nxt" fi suff=$((suff-1)) done mv -f "$1" "$1.1" } function revert_config { mv "$hack_ini" "$hack_ini.old" mv "$hack_ini.$1" "$hack_ini" } function revert_menu { echo '
'
cat "$web_dir$1.md"
printf '