#!/bin/bash set -e if ! lscpu | grep -qi "sgx"; then echo "SGX is not enabled. Please enable it in the BIOS." exit 1 fi if ! command -v docker &> /dev/null; then echo "Error: Docker is not installed." echo "Please install Docker by following the instructions at https://docs.docker.com/get-docker/" exit 1 fi echo "Creating folders..." mkdir -p /usr/local/bin/detee/ mkdir -p /etc/detee/app_daemon/ echo "Downloading detee-sgx-daemon, systemd unit file and config..." wget -q --show-progress -O /usr/local/bin/detee-sgx-daemon https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon wget -q --show-progress -O /etc/systemd/system/detee-sgx-daemon.service https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon.service wget -q --show-progress -O /etc/detee/app_daemon/sample_config.yaml https://registry.detee.ltd/sgx/daemon/sample_config.yaml chmod +x /usr/local/bin/detee-sgx-daemon echo "Take a look at /etc/detee/app_daemon/sample_config.yaml" echo "Modify config based on your setup and save it to /etc/detee/app_daemon/config.yaml" echo "Press enter when done (this will attempt to start the daemon)" read my_var echo "Starting detee-sgx-daemon..." systemctl daemon-reload systemctl start detee-sgx-daemon.service