30_update_get_the_site.sh 602 B

12345678910111213
  1. #!/bin/bash
  2. if [ ! -f "/var/www/PhotoShow/config.php" ]; then
  3. echo "fetching photoshow files from github"
  4. git clone https://github.com/thibaud-rohmer/PhotoShow.git /var/www/PhotoShow
  5. sed -i -e 's/$config->photos_dir.\+/$config->photos_dir = "\/Pictures";/' /var/www/PhotoShow/config.php
  6. sed -i -e 's/$config->ps_generated.\+/$config->ps_generated = "\/Thumbs";/' /var/www/PhotoShow/config.php
  7. else
  8. echo "checking for updates"
  9. cd /var/www/PhotoShow
  10. git pull
  11. fi
  12. sed -i -e "s@\$config->timezone.*@\$config->timezone = \"${TZ}\"@g" /var/www/PhotoShow/config.php
  13. chown -R abc:abc /var/www/PhotoShow /Thumbs