docker-trackmania/healthcheck.sh
2023-11-18 15:12:16 +01:00

9 lines
350 B
Bash

#!/bin/bash
#/bin/bash
STRING="<?xml version=\"1.0\" encoding=\"UTF-8\"?><methodCall><methodName>GetStatus</methodName><params></params></methodCall>"
LENGTH=$(printf "%s" "$STRING" | wc -c)
HEADER=$(printf "`printf '%s%08x' "0x80000000" "$LENGTH" `" | tac -rs ..)
RESULT=$(echo "$HEADER"| xxd -p -r)
echo -n $RESULT $STRING | nc -w1 localhost 5000