From ca26d5a0d09da4dc8e53dfdf7725311640ee691e Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 11 Sep 2025 22:49:43 +0200 Subject: [PATCH] Fix. --- testing/preseed.cfg | 1 + testing/scripts/update_preseed.sh | 1 + .../desktop/home/plom/.local/bin/setup_apps | 68 +++++++++++++++---- .../home/plom/.local/bin/update_discord | 19 ------ trixie/scripts/lib/constants_installer.sh | 1 + 5 files changed, 57 insertions(+), 33 deletions(-) create mode 120000 testing/preseed.cfg create mode 120000 testing/scripts/update_preseed.sh delete mode 100644 trixie/copy/desktop/home/plom/.local/bin/update_discord diff --git a/testing/preseed.cfg b/testing/preseed.cfg new file mode 120000 index 0000000..3d96d19 --- /dev/null +++ b/testing/preseed.cfg @@ -0,0 +1 @@ +../trixie/preseed.cfg \ No newline at end of file diff --git a/testing/scripts/update_preseed.sh b/testing/scripts/update_preseed.sh new file mode 120000 index 0000000..b88f66a --- /dev/null +++ b/testing/scripts/update_preseed.sh @@ -0,0 +1 @@ +../../trixie/scripts/update_preseed.sh \ No newline at end of file diff --git a/trixie/copy/desktop/home/plom/.local/bin/setup_apps b/trixie/copy/desktop/home/plom/.local/bin/setup_apps index 50e89a4..a9513c3 100755 --- a/trixie/copy/desktop/home/plom/.local/bin/setup_apps +++ b/trixie/copy/desktop/home/plom/.local/bin/setup_apps @@ -4,12 +4,12 @@ ROOT=$(dirname "$0") cd "${ROOT}" . lib/abort_if_offline.sh . lib/abort_if_command_unknown.sh +. lib/expect_n_args.sh abort_if_offline abort_if_command_unknown xz -TEMP_DIR=$(mktemp -d) -cd "${TEMP_DIR}" +expect_n_args 0 4 '[discord] [mattermost] [signal] [telegram]' "$@" install_with_repo() { local APP_NAME=$1 @@ -37,21 +37,61 @@ install_with_repo() { sudo apt install -y "${APP_NAME}-desktop" } -install_with_repo mattermost deb.packages.mattermost.com pubkey.gpg stable +install_telegram() { + local FILENAME_TGRAM_ARCHIVE=linux + local URL_TGRAM_ARCHIVE="https://telegram.org/dl/desktop/${FILENAME_TGRAM_ARCHIVE}" + local REL_PATH_TGRAM_DIR=Telegram + local REL_PATH_TGRAM_APP="${REL_PATH_TGRAM_DIR}/Telegram" + local PATH_TARGET="${ROOT}/telegram" + wget "${URL_TGRAM_ARCHIVE}" + tar xf "${FILENAME_TGRAM_ARCHIVE}" + mv "${REL_PATH_TGRAM_APP}" "${PATH_TARGET}" + rm -rf "${REL_PATH_TGRAM_DIR}" + rm "${FILENAME_TGRAM_ARCHIVE}" +} + +install_discord() { + local FILENAME_DISCORD_DEB_SOURCE='download?platform=linux' + local FILENAME_DISCORD_DEB_TARGET=discord.deb + local URL_DISCORD="https://discord.com/api/${FILENAME_DISCORD_DEB_SOURCE}" + wget "${URL_DISCORD}" + mv "${FILENAME_DISCORD_DEB_SOURCE}" "${FILENAME_DISCORD_DEB_TARGET}" + sudo apt install "./${FILENAME_DISCORD_DEB_TARGET}" + rm "${FILENAME_DISCORD_DEB_TARGET}" +} + +install_mattermost() { + install_with_repo mattermost deb.packages.mattermost.com pubkey.gpg stable +} -install_with_repo signal updates.signal.org/desktop/apt keys.asc xenial +install_signal() { + install_with_repo signal updates.signal.org/desktop/apt keys.asc xenial +} -FILENAME_TGRAM_ARCHIVE=linux -URL_TGRAM_ARCHIVE="https://telegram.org/dl/desktop/${FILENAME_TGRAM_ARCHIVE}" -REL_PATH_TGRAM_DIR=Telegram -REL_PATH_TGRAM_APP="${REL_PATH_TGRAM_DIR}/Telegram" -wget "${URL_TGRAM_ARCHIVE}" -tar xf "${FILENAME_TGRAM_ARCHIVE}" -mv "${REL_PATH_TGRAM_APP}" "${ROOT}/" -rm -rf "${REL_PATH_TGRAM_DIR}" -rm "${FILENAME_TGRAM_ARCHIVE}" +TEMP_DIR=$(mktemp -d) +cd "${TEMP_DIR}" -update_discord +if [ "$#" -eq 0 ]; then + install_signal + install_telegram + install_discord + install_mattermost +else + while [ "$#" -gt 0 ]; do + if [ "$1" = 'signal' ]; then + install_signal + elif [ "$1" = 'telegram' ]; then + install_telegram + elif [ "$1" = 'discord' ]; then + install_discord + elif [ "$1" = 'mattermost' ]; then + install_mattermost + else + echo "unrecognized target: $1" + fi + shift 1 + done +fi cd - rmdir "${TEMP_DIR}" diff --git a/trixie/copy/desktop/home/plom/.local/bin/update_discord b/trixie/copy/desktop/home/plom/.local/bin/update_discord deleted file mode 100644 index e24fe1c..0000000 --- a/trixie/copy/desktop/home/plom/.local/bin/update_discord +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env dash -set -e -ROOT=$(dirname "$0") -cd "${ROOT}" -. lib/abort_if_offline.sh - -TEMP_DIR=$(mktemp -d) -cd "${TEMP_DIR}" - -FILENAME_DISCORD_DEB_SOURCE='download?platform=linux' -FILENAME_DISCORD_DEB_TARGET=discord.deb -URL_DISCORD="https://discord.com/api/${FILENAME_DISCORD_DEB_SOURCE}" -wget "${URL_DISCORD}" -mv "${FILENAME_DISCORD_DEB_SOURCE}" "${FILENAME_DISCORD_DEB_TARGET}" -sudo apt install "./${FILENAME_DISCORD_DEB_TARGET}" -rm "${FILENAME_DISCORD_DEB_TARGET}" - -cd - -rmdir "${TEMP_DIR}" diff --git a/trixie/scripts/lib/constants_installer.sh b/trixie/scripts/lib/constants_installer.sh index 76e1589..4dcbd33 100644 --- a/trixie/scripts/lib/constants_installer.sh +++ b/trixie/scripts/lib/constants_installer.sh @@ -1,2 +1,3 @@ FILENAME_PRESEED_CFG=preseed.cfg PATH_PRESEED_CFG=$(realpath "../${FILENAME_PRESEED_CFG}") +ARGS_UPDATE_PRESEED='DEVICE (e.g. "sdb1") ROOT_PASSWORD WIFI_ESSID WIFI_PASSWORD' -- 2.30.2