mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
first test version https://github.com/alexbelgium/hassio-addons/issues/747
This commit is contained in:
16
free_games_claimer/rootfs/entrypoint.sh
Normal file
16
free_games_claimer/rootfs/entrypoint.sh
Normal 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
|
||||
14
free_games_claimer/rootfs/etc/cont-init.d/20-folders.sh
Normal file
14
free_games_claimer/rootfs/etc/cont-init.d/20-folders.sh
Normal 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/
|
||||
32
free_games_claimer/rootfs/etc/cont-init.d/99-run.sh
Normal file
32
free_games_claimer/rootfs/etc/cont-init.d/99-run.sh
Normal 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 " "
|
||||
3
free_games_claimer/rootfs/templates/config.yaml
Normal file
3
free_games_claimer/rootfs/templates/config.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
SHOW: 1
|
||||
WIDTH: 1280
|
||||
HEIGHT: 1280
|
||||
Reference in New Issue
Block a user