2017-04-24 01:38:47 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
while read QUERY; do
|
|
|
|
QUERY=($QUERY)
|
|
|
|
if [ "${QUERY[0]}" != "get" ]; then
|
|
|
|
echo "500 dunno"
|
|
|
|
continue
|
|
|
|
fi
|
2017-07-27 05:04:27 +08:00
|
|
|
result=$(curl -s http://172.22.1.251:8081/forwardinghosts.php?host=${QUERY[1]})
|
2017-04-24 01:38:47 +08:00
|
|
|
logger -t whitelist_forwardinghosts -p mail.info "Look up ${QUERY[1]} on whitelist, result $result"
|
|
|
|
echo ${result}
|
|
|
|
done
|