From 875585f5cd3cbe4aca2033d9551ff63f66dd8b40 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 24 Sep 2024 15:51:35 +0200 Subject: [PATCH] Create entry.sh --- entry.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 entry.sh diff --git a/entry.sh b/entry.sh new file mode 100644 index 0000000..cacf629 --- /dev/null +++ b/entry.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +info () { printf "%b%s%b" "\E[1;34m❯ \E[1;36m" "${1:-}" "\E[0m\n"; } +error () { printf "%b%s%b" "\E[1;31m❯ " "ERROR: ${1:-}" "\E[0m\n" >&2; } +warn () { printf "%b%s%b" "\E[1;31m❯ " "Warning: ${1:-}" "\E[0m\n" >&2; } + +trap 'error "Status $? while: $BASH_COMMAND (line $LINENO/$BASH_LINENO)"' ERR + +[ ! -f "/run/entry.sh" ] && error "Script must run inside Docker container!" && exit 11 +[ "$(id -u)" -ne "0" ] && error "Script must be executed with root privileges." && exit 12 + +echo "❯ Starting Umbrel for Docker v$(