#!/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 var/lib/bsdgames/criblog.new
config var/lib/bsdgames/saillog.new
config var/lib/bsdgames/cfscores.new
config var/lib/bsdgames/atc_score.new
config var/lib/bsdgames/phantasia/gold.new
config var/lib/bsdgames/phantasia/mess.new
config var/lib/bsdgames/phantasia/motd.new
config var/lib/bsdgames/phantasia/void.new
config var/lib/bsdgames/phantasia/monsters.new
config var/lib/bsdgames/phantasia/lastdead.new
config var/lib/bsdgames/phantasia/characs.new
config var/lib/bsdgames/phantasia/scoreboard.new
config var/lib/bsdgames/battlestar.log.new
config var/lib/bsdgames/robots_roll.new
config var/lib/bsdgames/snakerawscores.new
config var/lib/bsdgames/snake.log.new
rm -f var/lib/bsdgames/criblog.new var/lib/bsdgames/saillog.new var/lib/bsdgames/cfscores.new var/lib/bsdgames/atc_score.new var/lib/bsdgames/phantasia/gold.new var/lib/bsdgames/phantasia/mess.new var/lib/bsdgames/phantasia/motd.new var/lib/bsdgames/phantasia/void.new var/lib/bsdgames/phantasia/monsters.new var/lib/bsdgames/phantasia/lastdead.new var/lib/bsdgames/phantasia/characs.new var/lib/bsdgames/phantasia/scoreboard.new var/lib/bsdgames/battlestar.log.new var/lib/bsdgames/robots_roll.new var/lib/bsdgames/snakerawscores.new var/lib/bsdgames/snake.log.new
