This commit is contained in:
Alexandre
2023-05-25 20:26:19 +02:00
parent 0375999cd6
commit 5a0922bef2
4 changed files with 31 additions and 34 deletions

View File

@@ -28,12 +28,12 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_SERVICES_GRACETIME=0 S6_SERVICES_GRACETIME=0
RUN \ RUN \
# Custom scripts
sed -i "1a /./entrypoint.sh" /usr/local/bin/docker-entrypoint.sh && \
# Change data folder # Change data folder
sed -i "s|/fgc|/data|g" /usr/local/bin/docker-entrypoint.sh && \ sed -i "s|/fgc|/data|g" /usr/local/bin/docker-entrypoint.sh
sed -i 's|"$@"|$CMD_PARAMETERS|g' /usr/local/bin/docker-entrypoint.sh
# Define subreaper
ENV TINI_SUBREAPER=true
################## ##################
# 3 Install apps # # 3 Install apps #
################## ##################
@@ -73,11 +73,11 @@ RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get
# 4 Entrypoint # # 4 Entrypoint #
################ ################
#RUN chmod 777 /entrypoint.sh RUN chmod 777 /entrypoint.sh
WORKDIR /data WORKDIR /data
#ENTRYPOINT [ "/usr/bin/env" ] ENTRYPOINT [ "/usr/bin/env" ]
#CMD [ "/entrypoint.sh" ] CMD [ "/entrypoint.sh" ]
#SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
############ ############
# 5 Labels # # 5 Labels #

View File

@@ -76,6 +76,6 @@
}, },
"slug": "free_games_claimer", "slug": "free_games_claimer",
"url": "https://github.com/alexbelgium/hassio-addons", "url": "https://github.com/alexbelgium/hassio-addons",
"version": "1.4-test7", "version": "1.4",
"webui": "[PROTO:ssl]://[HOST]:[PORT:6080]" "webui": "[PROTO:ssl]://[HOST]:[PORT:6080]"
} }

View File

@@ -5,26 +5,26 @@
# Initialize # # Initialize #
############## ##############
# Delete file if existing # Use new config file
if [ -f /data/config.env ]; then CONFIG_HOME="$(bashio::config "CONFIG_LOCATION")"
rm /data/config.env CONFIG_HOME="$(dirname "$CONFIG_HOME")"
if [ ! -f "$CONFIG_HOME"/config.env ]; then
# Copy default config.env
cp /templates/config.env "$CONFIG_HOME"/config.env
chmod 777 "$CONFIG_HOME"/config.env
bashio::log.warning "A default config.env file was copied in $CONFIG_HOME. Please customize according to https://github.com/vogler/free-games-claimer/tree/main#configuration--options and restart the add-on"
else
bashio::log.warning "The config.env file found in $CONFIG_HOME will be used. Please customize according to https://github.com/vogler/free-games-claimer/tree/main#configuration--options and restart the add-on"
fi fi
# Use new config file # Copy new file
HOME="$(bashio::config "CONFIG_LOCATION")" \cp "$CONFIG_HOME"/config.env /data/
HOME="$(dirname "$HOME")"
if [ ! -f "$HOME"/config.env ]; then
# Copy default config.env
cp /templates/config.env "$HOME"/config.env
chmod 777 "$HOME"/config.env
bashio::log.warning "A default config.env file was copied in $HOME. Please customize according to https://github.com/vogler/free-games-claimer/tree/main#configuration--options and restart the add-on"
else
bashio::log.warning "The config.env file found in $HOME will be used. Please customize according to https://github.com/vogler/free-games-claimer/tree/main#configuration--options and restart the add-on"
fi
cp "$HOME"/config.env /data/
# Permissions # Permissions
chmod -R 777 "$HOME" chmod -R 777 "$CONFIG_HOME"
# Export variables
source "$CONFIG_HOME"/config.env
############## ##############
# Launch App # # Launch App #
@@ -38,8 +38,5 @@ echo " "
bashio::log.info "Starting the app with arguments $CMD_ARGUMENTS" bashio::log.info "Starting the app with arguments $CMD_ARGUMENTS"
echo " " echo " "
sed -i '$d' docker-entrypoint.sh
./docker-entrypoint.sh
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$CMD_ARGUMENTS docker-entrypoint.sh $CMD_ARGUMENTS

View File

@@ -1,3 +1,3 @@
SHOW=1 export SHOW=1
WIDTH=1280 export WIDTH=1280
HEIGHT=1280 export HEIGHT=1280