diff --git a/autodist-cgi b/autodist-cgi
index bb6547b..3dd72d7 100755
--- a/autodist-cgi
+++ b/autodist-cgi
@@ -2,8 +2,8 @@
. /etc/sysconfig/autoport
NUM=`echo "$QUERY_STRING" | sed -n 's/^.*NUM=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
-SECONDARY=`echo "$QUERY_STRING" | sed -n 's/^.*SECONDARY=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
-AS_SECONDARY=`echo "$QUERY_STRING" | sed -n 's/^.*AS_SECONDARY=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
+HOST=`echo "$QUERY_STRING" | sed -n 's/^.*HOST=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
+AS_HOST=`echo "$QUERY_STRING" | sed -n 's/^.*AS_HOST=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
SHOWLOG=`echo "$QUERY_STRING" | sed -n 's/^.*SHOWLOG=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
SHOWINDEX=`echo "$QUERY_STRING" | sed -n 's/^.*SHOWINDEX=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
LINES=`echo "$QUERY_STRING" | sed -n 's/^.*LINES=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
@@ -12,9 +12,13 @@ FORMAT=`echo "$QUERY_STRING" | sed -n 's/^.*FORMAT=\([^&]*\).*$/\1/p' | sed "s/%
[ ! "$FORMAT" ] && FORMAT=html
[ "$LINES" ] || LINES=5
-[ "$AS_SECONDARY" ] && SECONDARY_ADD="&SECONDARY=1"
-if [ ! "$AS_SECONDARY" -a "$FORMAT" = "xml" ]; then
+[ "$HOST" ] || HOST=0
+[ "$AS_HOST" ] || AS_HOST=0
+
+[ "$AS_HOST" -a "$HOST" != "0" ] && HOST_ADD="&HOST=$HOST"
+
+if [ "$AS_HOST" = "0" -a "$FORMAT" = "xml" ]; then
echo -e "Content-type: text/xml\nPragma: no-cache\n"
echo -n ""
+ [ "$RELOADTIME" ] && echo -n "$RELOADTIME"
+ echo ""
fi
fi
-fi
-[ ! "$AS_SECONDARY" ] && echo "
Generated by autodist CGI interface. Last update: `date`"
-
-if [ ! "$AS_SECONDARY" -a "$FORMAT" = "xml" ]; then
- echo -n "]]>"
- [ "$RELOADTIME" ] && echo -n "$RELOADTIME"
- echo ""
-fi