#!/bin/rc

# Vac score submission service.

# Authorized hosts: local addresses, Strand 1 hosts, clients, &c.
localhosts=(127.0.0.1 10.0.1.200 10.0.1.2 10.0.1.199)
ourhosts=(76.189.197.62 66.181.73.252)
clienthosts=($hosts 66.181.73.245)
guesthosts=(99.25.151.155)
okhosts=($localhosts $ourhosts $clienthosts $guesthosts)

rem=`{cat $3/remote}
port=`{echo $rem|sed 's/^[^!]*!//'}
rem=`{echo $rem|sed 's/!.*//'}

if (! ~ $rem $okhosts) {
	echo $rem is not authorized to submit scores to this host.
	exit hostauth
}
vacname=`{read}
cat > /lib/vac/^$vacname^.vac
