You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
951 B

#!/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