doinst.sh 715 B

12345678910111213141516171819202122232425
  1. config() {
  2. NEW="$1"
  3. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  4. # If there's no config file by that name, mv it over:
  5. if [ ! -r $OLD ]; then
  6. mv $NEW $OLD
  7. elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
  8. # toss the redundant copy
  9. rm $NEW
  10. fi
  11. # Otherwise, we leave the .new copy for the admin to consider...
  12. }
  13. config etc/timidity/eawpats.cfg.new
  14. # if there's no existing timidity.cfg, eawpats takes over.
  15. if [ ! -r etc/timidity/timidity.cfg ]; then
  16. ( cd etc/timidity ; ln -sf eawpats.cfg timidity.cfg )
  17. fi
  18. # SDL 1.2's SDL_mixer still uses the obsolete location for timidity.cfg:
  19. if [ ! -r etc/timidity.cfg ]; then
  20. ( cd etc ; ln -sf timidity/eawpats.cfg timidity.cfg )
  21. fi