#!/bin/sh
# $Id: fixversion,v 1.2 2001/10/02 07:52:19 zacheiss Exp $

if [ ! -f /etc/athena/version ]; then
    echo "No version file.  Contact an expert!"
    exit 1
fi

lastline=`tail -1 /etc/athena/version | grep Update`

if [ -z "$lastline" ]; then
    echo "/etc/athena/version is ok.  exiting."
    exit 2
fi

ed /etc/athena/version <<EOF >/dev/null 2>&1
\$d
w
q
EOF

if [ "$?" = 0 ]; then
    echo "/etc/athena/version fixed."
    echo "Reboot the machine now."
    exit 0
else
    echo "problems!  contact an expert!"
    exit 1
fi
