#!/bin/sh # Copyright (C) 1995 Jeffrey Chilton # # Permission is granted to anyone to make or distribute copies of # this program, in any medium, provided that the copyright notice # and permission notice are preserved, and that the distributor # grants the recipient permission for further redistribution as # permitted by this notice. # # Author's E-mail address: jwc@chilton.com STAGE=0 sigterm() { echo "$0: SIGTERM at stage $STAGE" >>/tmp/log/scripts exit 1 } trap sigterm 15 CMD="" LINE=`(/usr/sbin/nslookup $REMOTE_ADDR |/usr/bin/grep "name =") 2> /dev/null` if [ "$LINE" = "" ] then LOG_WHO="[$REMOTE_ADDR]" else LOG_WHO=`echo $LINE |/usr/bin/sed -e "s/^.*name = //"` fi if [ "$WWW_frequency" ] then CMD=`printf "$WWW_frequency\n" |/usr/local/bin/encode_freq` CMD="$CMD\n" fi if [ "$CMD" = "\n" ] then echo Content-type: text/html echo /bin/cat << E_O_F The Listening Post - Error

Frequency Change Rejected

The frequency you requested contains non-numeric characters or is outside the range the radio is capable of receiving. You must enter a frequency between 110KHz and 30MHz. (Don't enter the letters "MHz" or "KHz"; I'll figure it out from the value of the number.)

Some examples of valid entries are:

Note that the FM broadcast band - 88 to 108 MHz - is well above the range of frequencies this radio receives. Sorry, until I put a VHF radio on line, you can't get "Z-101" here.


Go to shortwave radio E_O_F TZ=UTC export TZ /bin/date "+%D %TZ $LOG_WHO $WWW_frequency (REJECT)" >>/logs/tuning exit fi CMD="$CMD$WWW_Modulation\n" CMD="$CMD$WWW_AGC\n" CMD="$CMD$WWW_Bandwidth\n" CMD="$CMD$WWW_Blanker\n" CMD="$CMD$WWW_RF\n" if [ $WWW_Modulation = "M6" ] then CMD="$CMD${WWW_Synchro:-SF}\n" fi STAGE=2 RESPONSE=`printf "$CMD" |/usr/local/bin/r8 |tr -d '\n'` STAGE=3 echo Content-type: text/html echo /bin/cat << E_O_F The Listening Post - Frequency Change Confirmed

Frequency Change Confirmed

Now go back to the Shortwave Radio page and click on the radio speaker [live audio] to hear what I'm hearing here. Note: If you use your browser's back button to return to the Shortwave Radio page, you may need to reload it to see this change in the Current Receiver Tuning section.

E_O_F if [ $RESPONSE ] then /bin/cat << E_O_F

Debugging info:

E_O_F

  /usr/bin/env |/usr/bin/grep "WWW_"
  echo ""
  echo "Command = $CMD"
  echo "Response = $RESPONSE"

  /bin/cat << E_O_F
E_O_F fi /bin/cat << E_O_F
Go to shortwave radio E_O_F TZ=UTC export TZ F=${WWW_frequency:-"n/c"} M=$WWW_Modulation if [ "$WWW_station" ] then S=\"$WWW_station\" fi /bin/date "+%D %TZ $LOG_WHO $F $M $S" >>/logs/tuning