doinst.sh 452 B

123456789101112131415
  1. # Handle configuration files
  2. config() {
  3. NEW="$1"
  4. OLD="`dirname $NEW`/`basename $NEW .new`"
  5. # If there's no config file by that name, mv it over:
  6. if [ ! -r $OLD ]; then
  7. mv $NEW $OLD
  8. elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
  9. rm $NEW
  10. fi
  11. # Otherwise, we leave the .new copy for the admin to consider...
  12. }
  13. # List of configuration files (they should end in .new)
  14. config etc/mozpluggerrc.new