doinst.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. preserve_perms() {
  14. NEW="$1"
  15. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  16. if [ -e $OLD ]; then
  17. cp -a $OLD ${NEW}.incoming
  18. cat $NEW > ${NEW}.incoming
  19. mv ${NEW}.incoming $NEW
  20. fi
  21. config $NEW
  22. }
  23. config etc/svxlink/svxlink.conf.new
  24. config etc/svxlink/TclVoiceMail.conf.new
  25. config etc/svxlink/gpio.conf.new
  26. config etc/svxlink/remotetrx.conf.new
  27. config etc/svxlink/svxreflector.conf.new
  28. config etc/svxlink/svxlink.d/ModuleFrn.conf.new
  29. config etc/svxlink/svxlink.d/ModuleHelp.conf.new
  30. config etc/svxlink/svxlink.d/ModuleEchoLink.conf.new
  31. config etc/svxlink/svxlink.d/ModuleDtmfRepeater.conf.new
  32. config etc/svxlink/svxlink.d/ModuleTclVoiceMail.conf.new
  33. config etc/svxlink/svxlink.d/ModuleSelCallEnc.conf.new
  34. config etc/svxlink/svxlink.d/ModulePropagationMonitor.conf.new
  35. config etc/svxlink/svxlink.d/ModuleMetarInfo.conf.new
  36. config etc/svxlink/svxlink.d/ModuleParrot.conf.new
  37. preserve_perms etc/rc.d/rc.svxlink.new
  38. if [ -x /usr/bin/update-desktop-database ]; then
  39. /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
  40. fi