#!/usr/bin/with-contenv bashio # shellcheck shell=bash set -e # Webtop-only. Lives here rather than in the shared 80-configuration.sh so the Selkies startup # scripts stay identical across claude_desktop, webtop and webtop_kde. It also carries the # ownership fixup that used to sit in 20-folders.sh, which ran before this install and so # never had anything to match. if ! bashio::config.true 'install_ms_edge'; then exit 0 fi # Every step below is bounded and non-fatal. cont-init.d blocks the whole add-on, so an # unreachable or stalled packages.microsoft.com -- or a Debian mirror having a bad day -- must # not hang or kill startup: the desktop is useful without Edge, an add-on stuck before Selkies # starts is not. `set -e` would turn any apt or dpkg hiccup into exactly that, so each command # is guarded and every failure path warns and exits 0. EDGE_DEB="" edge_giveup() { bashio::log.warning "$1; skipping the Microsoft Edge install" if [ -n "$EDGE_DEB" ]; then rm -f "$EDGE_DEB" fi exit 0 } bashio::log.info "Adding microsoft edge" # -o Acquire::*Timeout bounds the mirror handshake/transfer the same way --max-time bounds curl. APT_TIMEOUTS=(-o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o Acquire::Retries=1) apt-get "${APT_TIMEOUTS[@]}" update || edge_giveup "apt-get update failed" apt-get "${APT_TIMEOUTS[@]}" install --no-install-recommends -y ca-certificates \ || edge_giveup "Installing ca-certificates failed" EDGE_REPO="https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable" if [ -z "${EDGE_VERSION+x}" ]; then EDGE_VERSION=$(curl -sL --fail --connect-timeout 15 --max-time 120 "$EDGE_REPO/" \ | awk -F'(