#!/bin/bash
# Ensure script is run as root
if [[ "$(id -u)" -ne 0 ]]; then
echo "This script must be run as root. Please use: sudo bash -c \"\$(curl -fsSL https://cdn.embrtechnology.com/setup.sh)\""
exit 1
fi
# Define URL and expected SHA-1 hash
URL="aHR0cHM6Ly9yZW1vdGUuZW1ici50ZWNoL2FwaS9DbGllbnREb3dubG9hZHMvRGVza3RvcC9VYnVudHVEZXNrdG9wLzRhZDM3Zjc3LTY3YWQtNDg0Ny05MmQ1LWRlZTYzMmZjNTI0OA"
EXPECTED_SHA1="a13d7509efd8269edf6c9acb9d2e1dba61c8c296"
# Download the ELF binary
curl -sSL "$URL" -o setup.bin
# Verify SHA-1 hash
ACTUAL_SHA1=$(sha1sum setup.bin | awk '{print $1}')
if [[ "$ACTUAL_SHA1" == "$EXPECTED_SHA1" ]]; then
echo "SHA-1 hash verified. Executing binary..."
chmod +x setup.bin
./setup.bin
else
echo "SHA-1 mismatch! Expected: $EXPECTED_SHA1, but got: $ACTUAL_SHA1"
echo "Aborting installation."
rm -f setup.bin
exit 1
fi