This commit is contained in:
Alexandre
2023-05-22 16:04:50 +02:00
parent be801c7c78
commit 3b6eb569a4
15 changed files with 1059 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#!/bin/bash
echo "Starting..."
####################
# 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

View File

@@ -0,0 +1,14 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# Define home
# Creating config location
echo "Creating config location ..."
HOME="$(bashio::config "CONFIG_LOCATION")"
HOME="$(dirname "$HOME")"
mkdir -p $HOME
chmod -R 777 $HOME
# Copy files to data
echo "Copying files if needed..."
cp -rnf /fsg/* /data/

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
##############
# Initialize #
##############
HOME="$(bashio::config "CONFIG_LOCATION")"
HOME="$(dirname "$HOME")"
if [ ! -f "$HOME"/config.yaml ]; then
# Copy default config.json
cp /templates/config.yaml "$HOME"/config.yaml
chmod 777 "$HOME"/config.json
bashio::log.warning "A default config.yaml 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"
sleep 5
bashio::exit.nok
else
bashio::log.warning "The config.yaml 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
# Permissions
chmod -R 777 "$HOME"
##############
# Launch App #
##############
cd /data || true
echo " "
bashio::log.info "Starting the app"
echo " "

View File

@@ -0,0 +1,3 @@
SHOW: 1
WIDTH: 1280
HEIGHT: 1280