#!/bin/bash set -euxo pipefail shopt -s nullglob ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone printf "[PHP]\ndate.timezone = \"$TZ\"\n" > /usr/local/etc/php/conf.d/tzone.ini wwwRoot="/var/www/html" samRoot="$wwwRoot/sam" imageRoot="$wwwRoot/image" if [ ! -f "$samRoot/index.php" ]; then gosu www-data git clone $gameGitPath /var/www/html/sam fi if [ $HIDCHE_IMAGE_USE_INTERNAL = "yes" ] && [ ! -d "$imageRoot" ]; then if [[ "$imageRoot" =~ ^ssh ]]; then query=`echo "> /var/www/.ssh/known_hosts 2>/dev/null; chown www-data:www-data /var/www/.ssh/known_hosts chmod 600 /var/www/.ssh/known_hosts fi gosu www-data git clone $imgGitPath /var/www/html/image fi exec "$@"