doinst.sh 389 B

1234567891011121314151617
  1. #!/bin/sh
  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
  9. # toss the redundant copy
  10. rm $NEW
  11. fi
  12. # Otherwise, we leave the .new copy for the admin to consider...
  13. }
  14. config etc/rsnapshot.conf.new