doinst.sh 666 B

123456789101112131415161718192021222324
  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 @GALLERY_INSTALL@/.htaccess.new
  14. config @GALLERY_INSTALL@/index.php.new
  15. config @GALLERY_INSTALL@/php.ini.new
  16. config @GALLERY_INSTALL@/robots.txt.new
  17. if [ ! -d @GALLERY_INSTALL@/var ]; then
  18. mkdir @GALLERY_INSTALL@/var
  19. chown -R @WEBUSER@:@WEBGROUP@ @GALLERY_INSTALL@/var
  20. chmod 0777 @GALLERY_INSTALL@/var
  21. fi