#!/bin/bash

if [ -f /etc/uptime.record.old ]; then
  echo "/etc/uptime.record.old exists. Move it out of the way and reinstall"
  exit 1
fi

cat <<EOF
The uptime.record file format has been changed. Your /etc/uptime.record
will be updated. If you have other record files you can use ud-update(8)
to update them.
EOF

if [ -f /etc/uptime.record ]; then
  if [ "`head -1 /etc/uptime.record`" != "0.7.1" ]; then
    /usr/sbin/ud-update /etc/uptime.record
  fi
else
  cat >/etc/uptime.record <<EOF
0.7.1
0.000000

0.000000

0.000000

EOF
  chmod 644 /etc/uptime.record
fi

#DEBHELPER#

echo
echo "Configure UD by using /usr/sbin/udconfig"
echo
