( cd /usr/sbin ; rm -rf spattach )
( cd /usr/sbin ; ln -sf kissattach spattach )
# Process the incoming configuration files

if [ ! -f etc/ax25/ax25.profile ]
then
   mv install/conf/etc/ax25/ax25.profile etc/ax25/ax25.profile
else
   if [ "`md5sum install/conf/etc/ax25/ax25.profile | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/ax25.profile | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/ax25.profile etc/ax25/ax25.profile
   else
      rm install/conf/etc/ax25/ax25.profile
   fi
fi

if [ ! -f etc/ax25/ax25d.conf ]
then
   mv install/conf/etc/ax25/ax25d.conf etc/ax25/ax25d.conf
else
   if [ "`md5sum install/conf/etc/ax25/ax25d.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/ax25d.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/ax25d.conf etc/ax25/ax25d.conf
   else
      rm install/conf/etc/ax25/ax25d.conf
   fi
fi

if [ ! -f etc/ax25/axspawn.conf ]
then
   mv install/conf/etc/ax25/axspawn.conf etc/ax25/axspawn.conf
else
   if [ "`md5sum install/conf/etc/ax25/axspawn.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/axspawn.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/axspawn.conf etc/ax25/axspawn.conf
   else
      rm install/conf/etc/ax25/axspawn.conf
   fi
fi

if [ ! -f etc/ax25/nrbroadcast ]
then
   mv install/conf/etc/ax25/nrbroadcast etc/ax25/nrbroadcast
else
   if [ "`md5sum install/conf/etc/ax25/nrbroadcast | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/nrbroadcast | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/nrbroadcast etc/ax25/nrbroadcast
   else
      rm install/conf/etc/ax25/nrbroadcast
   fi
fi

if [ ! -f etc/ax25/rip98d.conf ]
then
   mv install/conf/etc/ax25/rip98d.conf etc/ax25/rip98d.conf
else
   if [ "`md5sum install/conf/etc/ax25/rip98d.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/rip98d.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/rip98d.conf etc/ax25/rip98d.conf
   else
      rm install/conf/etc/ax25/rip98d.conf
   fi
fi

if [ ! -f etc/ax25/rxecho.conf ]
then
   mv install/conf/etc/ax25/rxecho.conf etc/ax25/rxecho.conf
else
   if [ "`md5sum install/conf/etc/ax25/rxecho.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/rxecho.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/rxecho.conf etc/ax25/rxecho.conf
   else
      rm install/conf/etc/ax25/rxecho.conf
   fi
fi

if [ ! -f etc/ax25/ttylinkd.conf ]
then
   mv install/conf/etc/ax25/ttylinkd.conf etc/ax25/ttylinkd.conf
else
   if [ "`md5sum install/conf/etc/ax25/ttylinkd.conf | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum etc/ax25/ttylinkd.conf | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/etc/ax25/ttylinkd.conf etc/ax25/ttylinkd.conf
   else
      rm install/conf/etc/ax25/ttylinkd.conf
   fi
fi

if [ ! -f var/ax25/mheard/mheard.dat ]
then
   mv install/conf/var/ax25/mheard/mheard.dat var/ax25/mheard/mheard.dat
else
   if [ "`md5sum install/conf/var/ax25/mheard/mheard.dat | cut -d ' ' -f 1 2>/dev/null`" = "`md5sum var/ax25/mheard/mheard.dat | cut -d ' ' -f 1 2>/dev/null`" ]
   then
      mv install/conf/var/ax25/mheard/mheard.dat var/ax25/mheard/mheard.dat
   else
      rm install/conf/var/ax25/mheard/mheard.dat
   fi
fi

# Make sure the incoming conf directory is gone
rm -rf install/conf
