#!/bin/sh
PATH=/u/a/s/astoker/bin:/nyx/bin:/nyx/user/bin:/usr/local/bin:/usr/ucb:/bin:.:/etc:/usr/etc:/usr/games
FILES=files.$$
export FILES PATH
umask 22

## If there's an updated web page file, uncompress and untar it
cd /nyx/web/a/s/astoker
if [ ! -r netlink.tar.gz ]; then
	exit 0
fi
set -x

gunzip netlink.tar.gz
tar tf netlink.tar | grep '\.html' > $FILES
tar xpvf netlink.tar
/bin/rm netlink.tar

## Apply nyx.sed to change any Netlink specific features so that they can 
## be used on Nyx instead.
cat $FILES | while read html; do
	sed -f nyx.sed $html > newfile
	/bin/mv newfile $html
done

/bin/rm $FILES
