28 lines
734 B
Bash
Executable File
28 lines
734 B
Bash
Executable File
#!/bin/bash
|
|
set -euxo pipefail
|
|
shopt -s nullglob
|
|
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
wwwRoot="/var/www/html"
|
|
samRoot="$wwwRoot/sam"
|
|
imageRoot="$wwwRoot/image"
|
|
|
|
gameGitPath="https://storage.hided.net/gogs/devsam/core.git"
|
|
imgGitPath="https://storage.hided.net/gogs/devsam/image.git"
|
|
|
|
|
|
if [ ! -f "$wwwRoot/index.php" ]; then
|
|
echo "<?php header('location:sam',TRUE,301);" > $wwwRoot/index.php
|
|
chown www-data:www-data $wwwRoot/index.php
|
|
fi
|
|
|
|
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
|
|
gosu www-data git clone $imgGitPath /var/www/html/image
|
|
fi
|
|
|
|
exec "$@" |