mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-10 09:35:58 +02:00
First version
This commit is contained in:
27
epicgamesfree/rootfs/entrypoint.sh
Normal file
27
epicgamesfree/rootfs/entrypoint.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
echo "Starting..."
|
||||
|
||||
############################
|
||||
# Backup Dockerfile Script #
|
||||
############################
|
||||
|
||||
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
|
||||
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
|
||||
fi
|
||||
|
||||
####################
|
||||
# Starting scripts #
|
||||
####################
|
||||
|
||||
for SCRIPTS in /etc/cont-init.d/*; do
|
||||
[ -e "$SCRIPTS" ] || continue
|
||||
echo "$SCRIPTS: executing"
|
||||
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
|
||||
chmod a+x "$SCRIPTS"
|
||||
# Change shebang if no s6 supervision
|
||||
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
|
||||
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
|
||||
done
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# If dockerfile failed install manually
|
||||
|
||||
##############################
|
||||
# Automatic modules download #
|
||||
##############################
|
||||
if [ -e "/MODULESFILE" ]; then
|
||||
MODULES=$(</MODULESFILE)
|
||||
MODULES="${MODULES:-00-banner.sh}"
|
||||
echo "Executing modules script : $MODULES"
|
||||
|
||||
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true \
|
||||
&& mkdir -p /etc/cont-init.d \
|
||||
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
|
||||
&& chmod -R 755 /etc/cont-init.d
|
||||
fi
|
||||
|
||||
#######################
|
||||
# Automatic installer #
|
||||
#######################
|
||||
if [ -e "/ENVFILE" ]; then
|
||||
PACKAGES=$(</ENVFILE)
|
||||
echo "Executing dependency script with custom elements : $PACKAGES"
|
||||
|
||||
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
|
||||
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
|
||||
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
|
||||
&& chmod 777 /automatic_packages.sh \
|
||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||
&& rm /automatic_packages.sh
|
||||
fi
|
||||
|
||||
if [ -e "/MODULESFILE" ] && [ ! -f /entrypoint.sh ]; then
|
||||
for scripts in $MODULES; do
|
||||
echo "$scripts : executing"
|
||||
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/"$scripts"
|
||||
chmod a+x /etc/cont-init.d/"$scripts"
|
||||
/./etc/cont-init.d/"$scripts" || echo "/etc/cont-init.d/$scripts: exiting $?"
|
||||
rm /etc/cont-init.d/"$scripts"
|
||||
done | tac
|
||||
fi
|
||||
|
||||
#######################
|
||||
# Correct permissions #
|
||||
#######################
|
||||
[ -d /etc/services.d ] && chmod -R 777 /etc/services.d
|
||||
[ -d /etc/cont-init.d ] && chmod -R 777 /etc/cont-init.d
|
||||
7
epicgamesfree/rootfs/etc/cont-init.d/20-folders.sh
Normal file
7
epicgamesfree/rootfs/etc/cont-init.d/20-folders.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Define home
|
||||
HOME="/config/addons_config/epicgamesfree"
|
||||
mkdir -p $HOME
|
||||
chmod -R 777 $HOME
|
||||
30
epicgamesfree/rootfs/etc/cont-init.d/99-run.sh
Normal file
30
epicgamesfree/rootfs/etc/cont-init.d/99-run.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
##############
|
||||
# Initialize #
|
||||
##############
|
||||
|
||||
# Copy default config.json
|
||||
HOME="/config/addons_config/epicgamesfree"
|
||||
if [ ! -f "$HOME"/config.json ]; then
|
||||
cp /templates/config.json "$HOME"/config.json
|
||||
chmod 777 "$HOME"/config.json
|
||||
bashio::log.warning "A default config.json file was copied in $HOME. Please customize according to https://github.com/claabs/epicgames-freegames-node#json-configuration before restarting the addon"
|
||||
bashio::exit.nok
|
||||
fi
|
||||
|
||||
# Make symlink
|
||||
|
||||
if [ -f /usr/app/config/config.json ]; then rm /usr/app/config/config.json; fi
|
||||
ln -s "$HOME"/config.json /usr/app/config/config.json
|
||||
|
||||
##############
|
||||
# Launch App #
|
||||
##############
|
||||
|
||||
echo " "
|
||||
bashio::log.info "Starting the app"
|
||||
echo " "
|
||||
|
||||
/./usr/local/bin/docker-entrypoint.sh
|
||||
63
epicgamesfree/rootfs/templates/config.json
Normal file
63
epicgamesfree/rootfs/templates/config.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"runOnStartup": true,
|
||||
"cronSchedule": "5 16 * * *",
|
||||
"logLevel": "info",
|
||||
"webPortalConfig": {
|
||||
"baseUrl": "https://epic.exmaple.com",
|
||||
},
|
||||
"accounts": [
|
||||
{
|
||||
"email": "example@gmail.com",
|
||||
"password": "abc1234",
|
||||
"totp": "EMNCF83ULU3K3PXPJBSWY3DPEHPK3PXPJWY3DPEHPK3YI69R39NE"
|
||||
},
|
||||
],
|
||||
"notifiers": [
|
||||
// You may configure as many of any notifier as needed
|
||||
// Here are some examples of each type
|
||||
{
|
||||
"type": "email",
|
||||
"smtpHost": "smtp.gmail.com",
|
||||
"smtpPort": 587,
|
||||
"emailSenderAddress": "hello@gmail.com",
|
||||
"emailSenderName": "Epic Games Captchas",
|
||||
"emailRecipientAddress": "hello@gmail.com",
|
||||
"secure": false,
|
||||
"auth": {
|
||||
"user": "hello@gmail.com",
|
||||
"pass": "abc123",
|
||||
},
|
||||
},
|
||||
{
|
||||
"type": "discord",
|
||||
"webhookUrl": "https://discord.com/api/webhooks/123456789123456789/A-abcdefghijklmn-abcdefghijklmnopqrst12345678-abcdefghijklmnop123456",
|
||||
// Optional list of users or roles to mention
|
||||
"mentionedUsers": [
|
||||
"914360712086843432"
|
||||
],
|
||||
"mentionedRoles": [
|
||||
"734548250895319070"
|
||||
],
|
||||
},
|
||||
{
|
||||
"type": "telegram",
|
||||
"token": "644739147:AAGMPo-Jz3mKRnHRTnrPEDi7jUF1vqNOD5k",
|
||||
"chatId": "-987654321",
|
||||
},
|
||||
{
|
||||
"type": "apprise",
|
||||
"apiUrl": "http://192.168.1.2:8000",
|
||||
"urls": "mailto://user:pass@gmail.com",
|
||||
},
|
||||
{
|
||||
"type": "pushover",
|
||||
"token": "a172fyyl9gw99p2xi16tq8hnib48p2",
|
||||
"userKey": "uvgidym7l5ggpwu2r8i1oy6diaapll",
|
||||
},
|
||||
{
|
||||
"type": "gotify",
|
||||
"apiUrl": "https://gotify.net",
|
||||
"token": "SnL-wAvmfo_QT",
|
||||
},
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user