#!/bin/sh VERSION=4.11 BOARD=$( if test -e /sys/firmware/devicetree/base/model; then xargs -0 printf '%s\n' < /sys/firmware/devicetree/base/model | xargs printf '%s\n' | tail -n2 else echo Generic fi | tr -d '[:space:][:punct:]' ) if [ "$(id -u)" -gt 0 ]; then echo "Run with sudo..." >&2 exit fi case "$RELEASE" in test | local) REPO="dev.jadupc.com/deb" ;; *) REPO="deb.jadupc.com" ;; esac case "$BOARD" in TanixTX6) APTBOARD="tanix-tx6" ;; esac SWDIR="$(mktemp -d /tmp/.a2s.XXXXXXXXX)" trap 'rm -rf "$SWDIR"' TERM INT QUIT EXIT cd "$SWDIR" apt install curl ver="$( curl --disable -sL "https://$REPO/pool/main/j/jadupc-archive-keyring/" | grep -oE '[0-9]{4}\.[0-9]{1,2}\.[0-9]{1,2}(\+nmu[0-9]*)?' | sort -uVr | head -n1 )" curl --disable -sL# "https://$REPO/pool/main/j/jadupc-archive-keyring/jadupc-archive-keyring_${ver}_all.deb" -o keyring.deb dpkg -i keyring.deb cat > /etc/apt/sources.list.d/jadupc.list << EOF deb http://$REPO shopno main${APTBOARD:+ $APTBOARD} EOF apt update if dpkg -s armbian-bullseye-desktop-xfce > /dev/null 2>&1; then apt purge -y armbian-bullseye-desktop-xfce fi apt install -y base-files shopno-os-base shopno-os-apt-notifier shopno-os-log-sync date "+$VERSION-$BOARD-%Y%m%d" | tee /etc/img-release | xargs -0 printf 'Build version: %s\n'