

#!/bin/sh
echo "Creating local dmidecode for Docker usage."
if [ "$1" = "-s" ] && [ "$2" = "system-uuid" ]; then
    UUID_FILE="$HOME/.hytale_system_uuid"

    if [ -f "$UUID_FILE" ]; then
        cat "$UUID_FILE"
    else
        if command -v uuidgen >/dev/null 2>&1; then
            uuidgen | tr "A-Z" "a-z" | tee "$UUID_FILE" >/dev/null
        else
            cat /proc/sys/kernel/random/uuid | tee "$UUID_FILE" >/dev/null
        fi
        cat "$UUID_FILE"
    fi

    printf "\n"
    exit 0
fi

echo "dmidecode shim: unsupported args: $*" >&2
exit 1