#!/bin/sh . ./dtmfbox_cfg.cgi if [ ! -z "$(pidof 'dtmfbox')" ]; then status_daemon="running" else status_daemon="stopped" fi # &pid= if [ "${QUERY_STRING}" != "" ] && [ "$PID" = "" ]; then PID=`echo ${QUERY_STRING} | sed -n 's/.*pid=\(.*\)/\1/p' | sed -e 's/&.*//g'` fi # &no_startstop= if [ "${QUERY_STRING}" != "" ] && [ "$NO_STARTSTOP" = "" ]; then NO_STARTSTOP=`echo ${QUERY_STRING} | sed -n 's/.*no_startstop=\(.*\)/\1/p' | sed -e 's/&.*//g'` fi DO_REFRESH="10000" if [ "$DO_REFRESH" != "" ]; then STATUS_REFRESH=""; fi if [ "$status_daemon" = "running" ]; then status_accounts="`dtmfbox -list accounts`" status_connections="`dtmfbox -list`" status_clients="`dtmfbox -list clients`" fi # view log? if [ -f "/var/dtmfbox/tmp/dtmfbox.log" ] && [ "$NO_STARTSTOP" != "1" ]; then VIEWLOG_CMD="dtmfbox_cmd.cgi?binary=false&pid=$PID&script=cat%20/var/dtmfbox/tmp/dtmfbox.log" DELETELOG_CMD="$MAIN_CGI&pid=$PID&run_cmd=rm%20/var/dtmfbox/tmp/dtmfbox.log" btnViewLog="" if [ "$status_daemon" != "running" ]; then btnViewLog="$btnViewLog " fi btnViewLog="$btnViewLog" fi cat << EOF Content-Type: text/html dtmfbox - Status EOF if [ "$NO_STARTSTOP" != "1" ]; then if [ "$status_daemon" = "running" ]; then cat << EOF EOF else cat << EOF EOF fi fi cat << EOF $btnViewLog
dtmfbox running! dtmfbox stopped!
EOF

if [ "$status_daemon" = "running" ];
then
cat << EOF
Accounts
$status_accounts

Verbindungen
$status_connections

Clients
$status_clients
EOF fi cat << EOF $STATUS_REFRESH EOF