doinst.sh 607 B

12345678910111213141516171819202122232425262728
  1. config() {
  2. NEW="$1"
  3. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  4. if [ ! -r $OLD ]; then
  5. mv $NEW $OLD
  6. elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
  7. rm $NEW
  8. fi
  9. }
  10. preserve_perms() {
  11. NEW="$1"
  12. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  13. if [ -e $OLD ]; then
  14. cp -a $OLD ${NEW}.incoming
  15. cat $NEW > ${NEW}.incoming
  16. mv ${NEW}.incoming $NEW
  17. fi
  18. config $NEW
  19. }
  20. preserve_perms etc/rc.d/rc.cwiid.new
  21. config etc/rc.d/rc.cwiid.conf.new
  22. if [ -x /usr/bin/update-desktop-database ]; then
  23. /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
  24. fi