Skip to content

Commit

Permalink
Better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
UplandJacob authored Nov 3, 2024
1 parent 295ac59 commit cccfa17
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions eag-relay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,25 @@ RELAYS=$(bashio::config 'relays')
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 "relayConfig.ini:"
echo ""
bashio::log.green "relayConfig.ini:"
cat relayConfig.ini
echo ""



bashio::log.green "relays JSON unformatted:"
echo $RELAYS
echo ""

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

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

length=$(echo "$relayJSON" | jq '. | length')
echo "length: $length\n"

relays=""
for (( i=0; i<$length; i++ )); do
type=$(echo "$relayJSON" | jq -r ".[$i].type")
Expand All @@ -36,18 +45,15 @@ done

echo -e "$relays" > relays.txt

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

echo ""
echo ""

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

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

echo ""
echo ""

0 comments on commit cccfa17

Please sign in to comment.