40-install 849 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/with-contenv bash
  2. # fix for linting
  3. declare config
  4. # Set version
  5. PHOTOSHOW_COMMIT=$(cat /version.txt)
  6. # install photoshow
  7. if [ ! -d "/config/www/PhotoShow/.git" ]; then
  8. echo "fetching photoshow files from github"
  9. git clone https://github.com/thibaud-rohmer/PhotoShow.git /config/www/PhotoShow
  10. git --git-dir=/config/www/PhotoShow/.git --work-tree=/config/www/PhotoShow checkout ${PHOTOSHOW_COMMIT}
  11. sed -i \
  12. -e "s#$config->photos_dir.*#$config->photos_dir = \"/Pictures\";#g" \
  13. -e "s#$config->ps_generated.*#$config->ps_generated = \"/Thumbs\";#g" \
  14. -e "s#.*config->timezone.*#\$config->timezone = \"${TZ}\";#g" \
  15. /config/www/PhotoShow/config.php
  16. # patch in fixed keyboard.js file
  17. cp /defaults/keyboard.js /config/www/PhotoShow/src/js/keyboard.js
  18. fi
  19. # permissions
  20. chown -R abc:abc \
  21. /config/www/PhotoShow \
  22. /Thumbs