1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-10-02 21:47:12 +02:00
theme.park/docker/root/etc/cont-init.d/50-config

46 lines
1015 B
Plaintext
Raw Normal View History

2022-03-20 21:26:59 +01:00
#!/usr/bin/with-contenv bash
echo '------------------'
echo '| theme.park |'
echo '------------------'
# Display variables for troubleshooting
echo -e "Variables set:\\n\
2022-03-22 10:05:36 +01:00
PUID=${PUID}\\n\
PGID=${PGID}\\n\
TZ=${TZ}\\n\
TP_DOMAIN=${TP_DOMAIN}\\n\
TP_URLBASE=${TP_URLBASE}\\n"
2022-03-29 21:33:17 +02:00
# Remove forward slash
case ${TP_URLBASE} in
*"/"*)
TP_URLBASE=$(echo "${TP_URLBASE}" | sed 's/\///g')
;;
esac
2022-03-26 20:44:34 +01:00
DEFAULT='/defaults/default'
2022-03-29 21:33:17 +02:00
if [[ ${TP_URLBASE} ]]; then
if ! grep -q "${TP_URLBASE}" "${DEFAULT}"; then
sed -i "s/themepark/${TP_URLBASE}/g" ${DEFAULT}
fi
2022-03-29 21:33:17 +02:00
fi
2022-03-23 18:50:24 +01:00
cp /defaults/default /config/nginx/site-confs
2022-03-22 10:05:36 +01:00
# make our folders and links
mkdir -p \
/config/www/{css,resources}
# copy theme files
cp -R /app/themepark/css /config/www
cp -R /app/themepark/resources /config/www
cp /app/themepark/index.html /config/www
cp /app/themepark/themes.py /config/www
2022-03-22 21:22:10 +01:00
cp /app/themepark/CNAME /config/www
2022-03-22 10:05:36 +01:00
2022-03-28 18:12:13 +02:00
echo 'Creating CSS files'
python3 /config/www/themes.py
2022-03-22 10:05:36 +01:00
# permissions
chown -R abc:abc \
/config