sgx-daemon/scripts/install_daemon.sh
ghe0 95a405e44b
switch license to Apache2.0
- switch LICENSE file from GPLv2 to Apache-2.0
- add SPDX HEADER to all files
2025-06-14 03:57:18 +03:00

37 lines
1.3 KiB
Bash

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
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
wget -q --show-progress -O /etc/detee/root_ca.pem https://registry.detee.ltd/root_ca.pem
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