#!/usr/bin/env bash UMBREL_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/../.." UMBREL_OS_SCRIPTS="${UMBREL_ROOT}/scripts/umbrel-os" # Creates, enables and starts a systemd service enable_service() { service="${1}" if [ ! -f "/etc/systemd/system/${service}" ]; then echo "Setting up ${service}" if [ ! -f "${UMBREL_OS_SCRIPTS}/services/${service}" ]; then echo "Error: No service file found at ${UMBREL_OS_SCRIPTS}/services/${service}" exit 1 fi echo "Copying ${service} to /etc/systemd/system/${service}" cp "${UMBREL_OS_SCRIPTS}/services/${service}" "/etc/systemd/system/${service}" echo "Enabling ${service}..." systemctl enable "${service}" echo "Starting ${service}..." systemctl start "${service}" fi } # Enable all Umbrel services enable_service "umbrel-external-storage.service" enable_service "umbrel-startup.service" enable_service "umbrel-connection-details.service" exit 0