#!/bin/sh

current_channel=$1
dozap=""
while [ -z $dozap ] && [ -a /tmp/adzap.run ]
do
 
 wget http://www.werbesignal.dyndns.org/Werbesignal_client.php
 test=`grep "COLOR=lightpink><B>$current_channel<" Werbesignal_client.php`
 rm Werbesignal_client.php
 if [ -z "$test" ];  then 
    dozap="zapnow"
 fi
 
done

if [ -a /tmp/adzap.run ]; then
  svdrpsend.pl CHAN "$current_channel" 
  rm /tmp/adzap.run
fi  