Skip to content

Commit

Permalink
Remove inconsistent bashio logs
Browse files Browse the repository at this point in the history
  • Loading branch information
UplandJacob authored Nov 3, 2024
1 parent 354e312 commit 398cc3e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions eag-relay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
echo ""
echo ""


logGreen() {
echo -e "\033[32m$1\033[0m"
}

#get config
RELAY_CONFIG=$(bashio::config 'relayConfig')
RELAYS=$(bashio::config 'relays')
Expand All @@ -11,26 +16,26 @@ AUTO_RESTART=$(bashio::config 'autoRestart')
DEBUG_MODE=$(bashio::config 'debugMode')


bashio::log.green "relayConfig JSON:"
logGreen "relayConfig JSON:"
echo $RELAY_CONFIG
echo ""

config=$(echo "$RELAY_CONFIG" | jq -r 'to_entries | .[] | "\(.key): \(.value)"')
echo -e "[EaglerSPRelay]\nport: 6699\naddress: 0.0.0.0\n$config" > relayConfig.ini

echo ""
bashio::log.green "relayConfig.ini:"
logGreen "relayConfig.ini:"
cat relayConfig.ini
echo ""

echo ""
echo -e "\033[32mrelays JSON unformatted:\033[0m"
logGreen "relays JSON unformatted:"
echo $RELAYS
echo ""

relayJSON=$(echo $RELAYS | sed 's/}/},/g' | sed '$ s/,$//' | awk '{print "[" $0 "]"}')

bashio::log.green "relays JSON formatted:"
logGreen "relays JSON formatted:"
echo $relayJSON
echo ""

Expand All @@ -51,12 +56,12 @@ done

echo -e "$relays" > relays.txt

bashio::log.green "relays.txt:"
logGreen "relays.txt:"
cat relays.txt

echo ""
echo ""
bashio::log.green "Starting Eaglercraft relay..."
logGreen "Starting Eaglercraft relay..."
echo ""

#start relay (run.sh file is downloaded with relay)
Expand Down

0 comments on commit 398cc3e

Please sign in to comment.