#!/bin/sh
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
config etc/minicom.users.new
config etc/minirc.dfl.new
rm -f etc/minicom.users.new etc/minirc.dfl.new
( cd usr/bin ; rm -rf sb )
( cd usr/bin ; ln -sf sz sb )
( cd usr/bin ; rm -rf rb )
( cd usr/bin ; ln -sf rz rb )
( cd usr/bin ; rm -rf sz )
( cd usr/bin ; ln -sf lsz sz )
( cd usr/bin ; rm -rf sx )
( cd usr/bin ; ln -sf sz sx )
( cd usr/bin ; rm -rf lsb )
( cd usr/bin ; ln -sf lsz lsb )
( cd usr/bin ; rm -rf lrx )
( cd usr/bin ; ln -sf lrz lrx )
( cd usr/bin ; rm -rf lrb )
( cd usr/bin ; ln -sf lrz lrb )
( cd usr/bin ; rm -rf lsx )
( cd usr/bin ; ln -sf lsz lsx )
( cd usr/bin ; rm -rf rx )
( cd usr/bin ; ln -sf rz rx )
( cd usr/bin ; rm -rf rz )
( cd usr/bin ; ln -sf lrz rz )
