doinst.sh 550 B

1234567891011121314151617181920212223242526
  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.sonarqube.new
  21. config usr/share/sonarqube/conf/sonar.properties.new
  22. config usr/share/sonarqube/conf/wrapper.conf.new