BASEDIR=/home/server/www/org/wddb/www/ function report() { # sender UFLINE # return path RPLINE # we RECIPIENT # delivered to.. DTLINE # set } # continent continent=`grep "^continent" "$1" | sed 's/.*="\(.*\)"/\1/'` case "$continent" in africa|asia|australia|europe|northamerica|southamerica) ;; *) report "Allowed continents: africa|asia|australia|europe|northamerica|southamerica" ;; esac # other vars essid=`grep "^essid" "$1" | sed 's/.*="\(.*\)"/\1/'` # remove possible dots country=`grep "^country" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\.\.//g'` area=`grep "^area" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\//-/g' | sed 's/ //c'` mac=`grep "^mac" "$1" | sed 's/.*="\(.*\)"/\1/'` rate=`grep "^rate" "$1" | sed 's/.*="\(.*\)"/\1/'` wep=`grep "^wep" "$1" | sed 's/.*="\(.*\)"/\1/'` hints=`grep "^hints" "$1" | sed 's/.*="\(.*\)"/\1/'` location=`grep "^location" "$1" | sed 's/.*="\(.*\)"/\1/'` # check for empty fields for a in essid country area mac rate wep hints location; do eval tmp="\$$a" if [ -z "$tmp" ]; then report "Empty field: $a" fi done if [ ! -f $BASEDIR/$continent/$country/$area.html ]; then cat << EOF > "$1" wddb.org - WarDriver's DataBase else lines=`cat "$BASEDIR/$continent/$country/$area.html" | wc |awk '{ print $1 }'` use_lines=$[$lines-7] head -n $use_lines "$BASEDIR/$continent/$country/$area.html" > "$1" fi cat << EOF >> "$1"
<< One step back

Submit new network or changes EOF