#!/bin/sh # -------------------------------------------------------------------------------------------------------------------- # dtmfbox v0.3.9 - dsmod addon (c) 2007 Marco Zissen # # This program is free ! Use it at your own risk ! The author does not give any warranty ! # -------------------------------------------------------------------------------------------------------------------- DSMOD="1" DTMFBOX_VERSION="v0.3.9" MAX_ACCOUNTS=10 # max. number of accounts: 10 MAX_DTMFS=50 # max. number of dtmf-commands: 50 if [ "$DTMFBOX_PATH" = "" ]; then DTMFBOX_PATH="/var/dtmfbox"; fi # dsmod or mini_httpd ? if [ "$DSMOD" = "0" ]; then # FULLSCREEN . ./dtmfbox_lib.cgi if [ ! -f /var/dtmfbox/dtmfbox.save ]; then mkdir /var/dtmfbox 2>/dev/null cp ../../default.dtmfbox/dtmfbox.cfg /var/dtmfbox/dtmfbox.save fi # read config . /var/dtmfbox/dtmfbox.save else if [ "$DESIGN" != "mod" ]; then # FULLSCREEN . /usr/mww/cgi-bin/dtmfbox_lib.cgi else # MOD . /usr/lib/libmodcgi.sh . /usr/lib/libmodfrm.sh fi # read config . /mod/etc/conf/dtmfbox.cfg fi if [ "${QUERY_STRING}" != "" ]; then # Param: current Page if [ "$CURRENT_PAGE" = "" ]; then CURRENT_PAGE=`echo ${QUERY_STRING} | sed -n 's/.*current_page=\(.*\)/\1/p' | sed -e 's/&.*//g'` fi if [ "$CURRENT_PAGE" = "" ]; then # Param: Command if [ "$CMD" = "" ]; then CMD=`echo ${QUERY_STRING} | sed -n 's/.*command=\(.*\)/\1/p' | sed -e 's/&.*//g'` fi # execute a command if [ "$CMD" = "true" ]; then # Param: script script=`echo ${QUERY_STRING} | sed -n 's/.*script=\(.*\)/\1/p' | sed -e 's/&.*//' | sed -f /var/tmp/urldecode.sed` # Param: close close_window=`echo ${QUERY_STRING} | sed -n 's/.*close=\(.*\)/\1/p' | sed -e 's/&.*//'` # Run script echo "
" echo "$script" | sed "s/$(echo -ne '\r')//g" | sh | sed -e 's/&/\&/g ; s/\</g ; s/>/\>/g' echo "" # Close this window... if [ "$close_window" = "1" ]; then echo "" fi # Stop loading... echo "