#!/bin/sh

PROGNAME="${0}"
USERNAME="${1}"
LIST="kick-me achilles"

if [ ! -n "${USERNAME}" ]
then
   echo "${PROGNAME}: usage: ${PROGNAME} username"
   exit 1
fi

for SYSTEM in ${LIST}
do
   echo -n "Checking ${SYSTEM}... "
   rm -f /tmp/tether-${SYSTEM}
   tftp -g /tmp/tether-${SYSTEM} ${SYSTEM} /xyplex/${USERNAME}/ppp >/dev/null 2>&1
   if [ $? -eq 0 ]
   then
      echo "User has account on ${SYSTEM}."
   else
      echo "User does *not* have account on ${SYSTEM}."
   fi
   rm -f /tmp/tether-${SYSTEM}
done
