BASEDIR=/home/server/www/org/wddb/www/ tmp=/tmp/wddb-$$ function report() { # sender UFLINE # return path RPLINE # we RECIPIENT # delivered to.. DTLINE # set } function init() { cat > $tmp } # 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"