#!/bin/sh #------------------------------------------------------------------------------ # dyndns.cgi - display the answers from the dyndns services # part of Package DYNDNS __FLI4LVER__, see documentation for licence # # (c) copyright 2001-2002 Thomas Mueller # (c) copyright 2002-2003 Tobias Gruetzmacher # # Creation: 27.08.2001 Thomas Mueller # Last update: $Id$ #------------------------------------------------------------------------------ # set_debug=yes sanitize_log () { local sed_lang=/srv/www/lang/status_dyndns.sed.$lang if [ -f $sed_lang ] then sed -f /srv/www/admin/status_dyndns.sed $1 | sed -f $sed_lang else sed -f /srv/www/admin/status_dyndns.sed $1 fi } show_history () { host=$1 show_html_header "DynDNS-Status $host" show_tab_header "$_DYNDNS_tab_header" no sanitize_log $dyn_histdir/$host } show_status () { hist=$1 show_html_header "DynDNS-Status" show_tab_header "$_DYNDNS_tab_header" no cat < EOF for host in $dyn_hostdir/*.conf do host=`basename $host|sed -e 's/\.conf$//'` dyn_runfile="$dyn_rundir/$host" dyn_disabled="${dyn_runfile}.disabled" dyn_logfile="$dyn_logdir/$host" dyn_histfile="$dyn_histdir/$host" arg= if [ -n "$hist" ] then [ "$hist" != "$host" ] && continue dyn_logfile="$dyn_histfile" fi if [ -f $dyn_runfile ] then . $dyn_runfile last="`date -d $registered_date -D '%s' '+%d.%m.%Y %H:%M'`" state="Update not needed" else last=unknown state=unknown fi if [ -f $dyn_disabled ] then action=enable text="$_DYNDNS_action_enable" state="Update disabled" else if [ -f $dyn_runfile.pid ] then action=cancel text="$_DYNDNS_action_cancel" state="Update running" else action=update text="$_DYNDNS_action_update" arg= img="\"$text\"/" fi fi # # header # cat < $host, Current state: $state, Last succesful update: $last