doinst.sh 681 B

12345678910111213141516171819202122232425
  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. # Keep same perms on rc.mt-daapd.new:
  15. if [ -e etc/rc.d/rc.mt-daapd ]; then
  16. cp -a etc/rc.d/rc.mt-daapd etc/rc.d/rc.hald.new.incoming
  17. cat etc/rc.d/rc.mt-daapd.new > etc/rc.d/rc.hald.new.incoming
  18. mv etc/rc.d/rc.mt-daapd.new.incoming etc/rc.d/rc.hald.new
  19. fi
  20. config etc/rc.d/rc.mt-daapd.new
  21. config etc/mt-daapd.conf.new