From fc1554cee965e03215e40210bbc5c32d2389d652 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sat, 14 Feb 2026 17:17:34 +0100 Subject: [PATCH 1/6] added latest Nachinstallationsarbeiten script provided by Martin --- ...tallationsarbeiten_LC_Esslingen_XFCE_v8.sh | 256 ++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh diff --git a/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh b/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh new file mode 100644 index 0000000..e50c371 --- /dev/null +++ b/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh @@ -0,0 +1,256 @@ +#!/bin/bash + + +# "Anderungs Historie +# Datum Version Name Änderung +# 2025-11-11 v6 MartinP mehr Erläuterungen reingeschrieben +# 2025-11-17 v7 Mark Simualtion Modus und 32Bit abfrage entfernt +# 2025-12-12 v8 MartinP Erläuterungen ergänzt und Typos entfernt +# + +bIsVlcInstalled=false + + +echo " +################################### +#### Nachinstallationsarbeiten #### +################################### + +#### Was tut dieses Skript? #### + +# Vorausgesetzt wird eine Installation von Linux Mint XFCE. +# Das Skript bietet -teilweise interaktiv- die Installation von zusätzlichen Programmen an, die Linux Mint XFCE nicht standardmässig mitbringt. +# +# Zu Beginn werden -ohne weitere Rückfrage- die folgenden zusätzlichen Programme installiert: +# +# xfce4-goodies (zusätzliche Elemente für die Taskleiste) +# xfce4-panel-profiles (Tool für die Taskleistenbearbeitung) +# clementine (Audioplayer und Musikbibliothekverwaltung) +# vlc (weltbester Mediaplayer ;-)) +# htop (Systemmonitortool) +# hardinfo (Übersicht der Systemeigenschaften) +# font-manager (Schriftarten verwalten) +# asunder (Audio-CDs in z.B. mp3-Dateien verwandeln (rippen)) +# gtkhash (Prüfsummen von Dateien erstellen und überprüfen) + + +# Danach geht es interaktiv weiter. +" +# +# +# + sudo apt-get update + +sSuffixDate=$(date '+%Y-%m-%d_%H:%M:%S') + + +echo +read -p "#### 64 bit Mint XFCE ; Zusatzprogramme #### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "#### 64 bit Mint XFCE ####" + sudo apt -y install xfce4-goodies clementine vlc htop hardinfo font-manager asunder gtkhash xfce4-panel-profiles + bIsVlcInstalled=true +fi + +echo "" +echo "" +echo +echo +echo "#### nur auf Wunsch / bei Bedarf ####" +echo +### Sensoren ### +read -p " ### Sensoren ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### Sensoren ###" + sudo apt install lm-sensors psensor + sudo sensors-detect + sudo service kmod start + echo "## im Anschluss "psensor" konfigurieren im XFCE-Applet in der Taskleiste" +fi + + +echo +echo +if $bIsVlcInstalled; then + echo "### Kauf-DVDs abspielen ###" + read -p " ### Film DVDs ### + Geben Sie j oder n ein und die Eingabetaste, + Abbruch mit jeder anderen Taste ... " kommando; + if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### Kauf-DVDs abspielen ###" + sudo apt install libdvd-pkg + sudo dpkg-reconfigure libdvd-pkg + fi +else + echo "Player Fehlt + ## VLC muss installiert sein um Kauf-DVDs abspielen zu können" +fi + + +echo +echo +echo "### Schriften, falls Microsoft-Office-Dokumente weiterverwendet werden sollen oder Dokumentenaustausch mit Microsoft-Nutzern gewünscht ist ### +## frei verfügbare, alte Microsoft-Standardschriften installieren:" + +read -p " ### M$ Schriften ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### M$ Schriften ###" + sudo apt install ttf-mscorefonts-installer +fi + +echo +echo +echo " ## freie Google-Schriften als Ersatz für aktuelle MS-Standardschriften installieren:" +read -p " ### Google Schriften ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo + echo "### Google Schriften ###" + + _gf="google-fonts" + fGoogleSchriften=./$_gf".tar.gz" + if [ ! -f "$fGoogleSchriften" ]; then + echo "" + echo "$fGoogleSchriften nicht gefunden." + echo " soll das Archiv "google-fonts.tar.gz" von Github heruntergeladen werden? Es ist ca. 1,4GB gross! " + read -p " ### Download Google Schriften ### + Geben Sie j oder n ein und die Eingabetaste, + Abbruch mit jeder anderen Taste ... " runterLaden; + if [ $runterLaden == 'j' -o $runterLaden == 'J' -o $runterLaden == 'ja' -o $runterLaden == 'y' -o $runterLaden == 'Y' ]; then + _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" + echo "Connecting to Github server to download fonts..." + wget $_wgeturl -O $_gf.tar.gz + fi + fi + if [ -f "$fGoogleSchriften" ]; then + echo + echo "$fGoogleSchriften nicht gefunden." + echo "Extracting the downloaded archive..." + tar -zxvf $_gf.tar.gz + echo "Creating the /usr/share/fonts/truetype/$_gf folder" + sudo mkdir -p /usr/share/fonts/truetype/$_gf + echo "Installing all .ttf fonts in /usr/share/fonts/truetype/$_gf" + find $PWD/fonts-main/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; || echo "An error occured, please run this script again." + echo "Updating the font cache" + fc-cache -f + echo "Done. Now you can delete the tarball file $_gf.tar.gz if you wish." + + echo "Temporärer Fontordner wird gelöscht" + rm -r fonts-main + echo "Google-Schriften sind installiert. Die Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office muss manuell erfolgen, falls gewünscht." + else + echo "Schriften Fehlen immer noch. Manuell herunterladen und installieren" + fi + +fi +# + + + + +echo +echo +echo "#### Chromium Browser installieren:" +read -p " ### Chromium ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### Chromium ###" + sudo apt install chromium-browser + sudo apt install chromium + fi88= +fi + +echo +echo +echo "#### Vivaldi Browser installieren:" +read -p " ### Vivaldi ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### ###" + echo "## nötige Zusatzpakete installieren" + sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y + # + echo "## ## key importieren" + curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo tee /usr/share/keyrings/vivaldi.gpg > /dev/null + # + echo "## ## Repository hinzufügen" + echo deb [arch=amd64,armhf signed-by=/usr/share/keyrings/vivaldi.gpg] https://repo.vivaldi.com/stable/deb/ stable main | sudo tee /etc/apt/sources.list.d/vivaldi.list + # + sudo apt update && sudo apt install vivaldi-stable + # + echo "## ## Gnome-Schlüsselbund-Fehlermeldung bei jedem Start von Chrome/Chromium beheben: Starter bzw. .desktop-Datei mit folgendem Parameter ergänzen: " + echo "## ## --password-store=basic" + # +fi + + + +echo +echo +echo "####Signal für Desktop (die Nutzung setzt eine Signal-Installation auf einem Android- Oder Apple-Gerät voraus!)#### " +read -p " ### Signal ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### ###" + echo "## zusätzliches Repository nötig! + ## NOTE: These instructions only work for 64-bit Debian-based + ## Linux distributions such as Ubuntu, Mint etc. + ## key importieren + " + wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg + cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null + # + echo "## Repository hinzufügen:" + echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | sudo tee /etc/apt/sources.list.d/signal-xenial.list + sudo apt update && sudo apt install signal-desktop + # + +fi + + + +echo +echo +echo "### Anpassung der Panel-Konfiguration / Taskleiste #### " +echo "### SystemMonitor, ArbeitsflächenAnzeige #### " +echo +echo "Achtung! Es kann vorkommen, dass die Taskleiste nach diesem Schritt verschwunden ist." +echo "Ein Abmelden und Wiederanmelden des Benutzers oder ein Reboot behebt das Problem." +echo +read -p " ### Panel ### +Geben Sie j oder n ein und die Eingabetaste, +Abbruch mit jeder anderen Taste ... " kommando; +if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then + echo "### ###" + echo "## Austausch der Panel-Konfigurationsdatei:" + xfce4-panel-profiles load current-config.tar.bz2 +fi +echo +echo "###############################" +echo "######### Skript ENDE #########" +echo "###############################" +echo +echo +echo +echo "Verbleibende manuelle Schritte:" +echo +echo "### Taskleiste ###: XFCE-Applets für 2x Netzwerkmonitor (LAN + WLAN) konfigurieren" +echo +echo "Wenn ### Sensoren ### installiert wurden: psensor konfigurieren im XFCE-Applet in der Taskleiste, falls gewünscht." +echo +echo "Wenn ### Google-Schriften ### installiert wurden: Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office, falls gewünscht." +echo +echo +read -p " ### Um dieses Fenster zu schliessen, "Enter" drücken ### " kommando; +if [ $kommando == 'j' -o $kommando == 'J' ]; then + return From 3c6856d68b9c379e5c84773da3ef82bde01a01f0 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sat, 14 Feb 2026 18:52:13 +0100 Subject: [PATCH 2/6] fixed problem with unexpected operator after pressing 'j' --- ...tallationsarbeiten_LC_Esslingen_XFCE_v8.sh | 170 ++++++++---------- 1 file changed, 75 insertions(+), 95 deletions(-) diff --git a/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh b/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh index e50c371..14ff8cc 100644 --- a/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh +++ b/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh @@ -10,6 +10,18 @@ bIsVlcInstalled=false +# Prompt helper: ask a question and return 0 (yes) for j/J/ja/y/Y, non-zero otherwise +question_answered_with_yes() { + local prompt="$1" + local ans + # -r prevents backslash escapes being interpreted; -p prints the prompt + read -rp "$prompt [j/N]: " ans + case "$ans" in + j|J|ja|y|Y) return 0 ;; + *) return 1 ;; + esac +} + echo " ################################### @@ -45,13 +57,10 @@ sSuffixDate=$(date '+%Y-%m-%d_%H:%M:%S') echo -read -p "#### 64 bit Mint XFCE ; Zusatzprogramme #### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "#### 64 bit Mint XFCE ####" - sudo apt -y install xfce4-goodies clementine vlc htop hardinfo font-manager asunder gtkhash xfce4-panel-profiles - bIsVlcInstalled=true +if question_answered_with_yes "#### 64 bit Mint XFCE ; Zusatzprogramme ####\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "#### 64 bit Mint XFCE ####" + sudo apt -y install xfce4-goodies clementine vlc htop hardinfo font-manager asunder gtkhash xfce4-panel-profiles + bIsVlcInstalled=true fi echo "" @@ -61,33 +70,27 @@ echo echo "#### nur auf Wunsch / bei Bedarf ####" echo ### Sensoren ### -read -p " ### Sensoren ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### Sensoren ###" - sudo apt install lm-sensors psensor - sudo sensors-detect - sudo service kmod start - echo "## im Anschluss "psensor" konfigurieren im XFCE-Applet in der Taskleiste" +if question_answered_with_yes " ### Sensoren ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### Sensoren ###" + sudo apt install lm-sensors psensor + sudo sensors-detect + sudo service kmod start + echo "## im Anschluss \"psensor\" konfigurieren im XFCE-Applet in der Taskleiste" fi echo echo -if $bIsVlcInstalled; then - echo "### Kauf-DVDs abspielen ###" - read -p " ### Film DVDs ### - Geben Sie j oder n ein und die Eingabetaste, - Abbruch mit jeder anderen Taste ... " kommando; - if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### Kauf-DVDs abspielen ###" - sudo apt install libdvd-pkg - sudo dpkg-reconfigure libdvd-pkg - fi +if [ "$bIsVlcInstalled" = true ]; then + echo "### Kauf-DVDs abspielen ###" + if question_answered_with_yes " ### Film DVDs ###\n\tGeben Sie j oder n ein und die Eingabetaste,\n\tAbbruch mit jeder anderen Taste ..."; then + echo "### Kauf-DVDs abspielen ###" + sudo apt install libdvd-pkg + sudo dpkg-reconfigure libdvd-pkg + fi else - echo "Player Fehlt - ## VLC muss installiert sein um Kauf-DVDs abspielen zu können" + echo "Player Fehlt + ## VLC muss installiert sein um Kauf-DVDs abspielen zu können" fi @@ -96,23 +99,17 @@ echo echo "### Schriften, falls Microsoft-Office-Dokumente weiterverwendet werden sollen oder Dokumentenaustausch mit Microsoft-Nutzern gewünscht ist ### ## frei verfügbare, alte Microsoft-Standardschriften installieren:" -read -p " ### M$ Schriften ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### M$ Schriften ###" - sudo apt install ttf-mscorefonts-installer +if question_answered_with_yes " ### M$ Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### M$ Schriften ###" + sudo apt install ttf-mscorefonts-installer fi echo echo echo " ## freie Google-Schriften als Ersatz für aktuelle MS-Standardschriften installieren:" -read -p " ### Google Schriften ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo - echo "### Google Schriften ###" +if question_answered_with_yes " ### Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo + echo "### Google Schriften ###" _gf="google-fonts" fGoogleSchriften=./$_gf".tar.gz" @@ -120,27 +117,23 @@ if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == ' echo "" echo "$fGoogleSchriften nicht gefunden." echo " soll das Archiv "google-fonts.tar.gz" von Github heruntergeladen werden? Es ist ca. 1,4GB gross! " - read -p " ### Download Google Schriften ### - Geben Sie j oder n ein und die Eingabetaste, - Abbruch mit jeder anderen Taste ... " runterLaden; - if [ $runterLaden == 'j' -o $runterLaden == 'J' -o $runterLaden == 'ja' -o $runterLaden == 'y' -o $runterLaden == 'Y' ]; then - _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" - echo "Connecting to Github server to download fonts..." - wget $_wgeturl -O $_gf.tar.gz - fi + if question_answered_with_yes " ### Download Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" + echo "Connecting to Github server to download fonts..." + wget "$_wgeturl" -O "$_gf.tar.gz" + fi fi - if [ -f "$fGoogleSchriften" ]; then - echo - echo "$fGoogleSchriften nicht gefunden." - echo "Extracting the downloaded archive..." - tar -zxvf $_gf.tar.gz - echo "Creating the /usr/share/fonts/truetype/$_gf folder" - sudo mkdir -p /usr/share/fonts/truetype/$_gf - echo "Installing all .ttf fonts in /usr/share/fonts/truetype/$_gf" - find $PWD/fonts-main/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; || echo "An error occured, please run this script again." - echo "Updating the font cache" - fc-cache -f - echo "Done. Now you can delete the tarball file $_gf.tar.gz if you wish." + if [ -f "$fGoogleSchriften" ]; then + echo + echo "Extracting the downloaded archive..." + tar -zxvf "$_gf.tar.gz" + echo "Creating the /usr/share/fonts/truetype/$_gf folder" + sudo mkdir -p /usr/share/fonts/truetype/$_gf + echo "Installing all .ttf fonts in /usr/share/fonts/truetype/$_gf" + find "$PWD/fonts-main/" -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; || echo "An error occured, please run this script again." + echo "Updating the font cache" + fc-cache -f + echo "Done. Now you can delete the tarball file $_gf.tar.gz if you wish." echo "Temporärer Fontordner wird gelöscht" rm -r fonts-main @@ -158,26 +151,19 @@ fi echo echo echo "#### Chromium Browser installieren:" -read -p " ### Chromium ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### Chromium ###" - sudo apt install chromium-browser - sudo apt install chromium - fi88= +if question_answered_with_yes " ### Chromium ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### Chromium ###" + sudo apt install chromium-browser + sudo apt install chromium fi echo echo echo "#### Vivaldi Browser installieren:" -read -p " ### Vivaldi ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### ###" - echo "## nötige Zusatzpakete installieren" - sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y +if question_answered_with_yes " ### Vivaldi ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### ###" + echo "## nötige Zusatzpakete installieren" + sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y # echo "## ## key importieren" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo tee /usr/share/keyrings/vivaldi.gpg > /dev/null @@ -197,16 +183,13 @@ fi echo echo echo "####Signal für Desktop (die Nutzung setzt eine Signal-Installation auf einem Android- Oder Apple-Gerät voraus!)#### " -read -p " ### Signal ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### ###" - echo "## zusätzliches Repository nötig! - ## NOTE: These instructions only work for 64-bit Debian-based - ## Linux distributions such as Ubuntu, Mint etc. - ## key importieren - " +if question_answered_with_yes " ### Signal ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### ###" + echo "## zusätzliches Repository nötig! + ## NOTE: These instructions only work for 64-bit Debian-based + ## Linux distributions such as Ubuntu, Mint etc. + ## key importieren + " wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null # @@ -227,13 +210,10 @@ echo echo "Achtung! Es kann vorkommen, dass die Taskleiste nach diesem Schritt verschwunden ist." echo "Ein Abmelden und Wiederanmelden des Benutzers oder ein Reboot behebt das Problem." echo -read -p " ### Panel ### -Geben Sie j oder n ein und die Eingabetaste, -Abbruch mit jeder anderen Taste ... " kommando; -if [ $kommando == 'j' -o $kommando == 'J' -o $kommando == 'ja' -o $kommando == 'y' -o $kommando == 'Y' ]; then - echo "### ###" - echo "## Austausch der Panel-Konfigurationsdatei:" - xfce4-panel-profiles load current-config.tar.bz2 +if question_answered_with_yes " ### Panel ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + echo "### ###" + echo "## Austausch der Panel-Konfigurationsdatei:" + xfce4-panel-profiles load current-config.tar.bz2 fi echo echo "###############################" @@ -251,6 +231,6 @@ echo echo "Wenn ### Google-Schriften ### installiert wurden: Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office, falls gewünscht." echo echo -read -p " ### Um dieses Fenster zu schliessen, "Enter" drücken ### " kommando; -if [ $kommando == 'j' -o $kommando == 'J' ]; then - return +if question_answered_with_yes " ### Um dieses Fenster zu schliessen, \"Enter\" drücken ###"; then + exit 0 +fi From bc1e17ec0461307652f5269321b182136513956f Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 15 Feb 2026 17:53:46 +0100 Subject: [PATCH 3/6] added test infrastructure based on docker/podman * documentation added * scripts to setup image and start container added --- .agents/AGENTS.md | 168 ++++++++++++++++++ .gitignore | 24 +++ ...tallationsarbeiten_LC_Esslingen_XFCE_v8.sh | 24 +-- ...achinstallationsarbeiten_Konsole_v2.txt.sh | 0 post_installation_script/README.md | 18 ++ .../01_create_image.sh | 4 + .../02_start_container_with_image.sh | 7 + post_installation_script_test/Dockerfile | 41 +++++ post_installation_script_test/README.md | 60 +++++++ 9 files changed, 334 insertions(+), 12 deletions(-) create mode 100644 .agents/AGENTS.md create mode 100644 .gitignore rename 20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh => post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh (84%) rename 231013_nachinstallationsarbeiten_Konsole_v2.txt.sh => post_installation_script/231013_nachinstallationsarbeiten_Konsole_v2.txt.sh (100%) create mode 100644 post_installation_script/README.md create mode 100755 post_installation_script_test/01_create_image.sh create mode 100755 post_installation_script_test/02_start_container_with_image.sh create mode 100644 post_installation_script_test/Dockerfile create mode 100644 post_installation_script_test/README.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md new file mode 100644 index 0000000..a225c4b --- /dev/null +++ b/.agents/AGENTS.md @@ -0,0 +1,168 @@ +AGENTS + +I created this `AGENTS.md` to help agentic coding assistants work in this repository. It contains +1) Build / lint / test commands (including how to run a single test) and +2) Code style guidelines and conventions to follow when editing code here. + +Repository state +- This repository contains shell scripts for Linux Mint XFCE post-installation setup. +- Main scripts are located in `post_installation_script/` directory. +- Testing infrastructure is in `post_installation_script_test/` (Docker/Podman test containers). +- No build system, package.json, Makefile, or language-specific project files were detected. +- There are no Cursor rules or Copilot instruction files in the repo (checked paths below). + - `.cursor/rules/` : not found + - `.cursorrules` : not found + - `.github/copilot-instructions.md` : not found + +If you add new code (Go, Python, Node, Rust, Java, etc.), follow the per-ecosystem quick commands below. + +1) Build / Lint / Test commands + +- General notes + - Run commands from the repository root unless a submodule or service has its own README. + - Prefer local, repo-scoped toolchains (venv, node_modules/.bin, go modules, cargo) to avoid global state. + +- Shell scripts + - Quick check: `shellcheck scripts/*.sh` (install `shellcheck` first). + - Run an individual script: `bash path/to/script.sh` or `./script.sh` (ensure executable bit set). + - Syntax check: `bash -n path/to/script.sh` + - Trace execution: `bash -x path/to/script.sh` (shows each command as it runs) + +- Testing shell scripts + - See `post_installation_script_test/README.md` for detailed container-based testing instructions. + - Quick start: + - Build image: `./post_installation_script_test/01_create_image.sh` + - Start container: `./post_installation_script_test/02_start_container_with_image.sh` + +- Python (if added) + - Install: `python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt` + - Lint: `ruff .` or `flake8 .` + - Format: `black .` + - Test all: `pytest -q` + - Run a single test: `pytest path/to/test_file.py::TestClass::test_method -q` + +- Node / JavaScript / TypeScript (if added) + - Install: `npm ci` or `pnpm install` / `yarn install` + - Lint: `npm run lint` (or `npx eslint .`) + - Format: `npx prettier --write .` + - Test all: `npm test` (or `npx vitest` / `npx jest`) + - Run a single test: + - Jest: `npx jest path/to/file.test.js -t "test name regex"` + - Vitest: `npx vitest run path/to/file.spec.ts -t "test name"` + +- Go (if added) + - Build: `go build ./...` + - Lint: `golangci-lint run` (if configured) + - Test all: `go test ./...` + - Run a single test: `go test ./pkg/name -run TestFunctionName` + +- Rust (if added) + - Build: `cargo build` + - Lint: `cargo clippy` + - Test all: `cargo test` + - Run a single test: `cargo test test_name -- --exact` + +- Java / Maven (if added) + - Build: `mvn -DskipTests package` + - Lint/format: use `spotless`/`checkstyle` if configured + - Test all: `mvn test` + - Run a single test: `mvn -Dtest=ClassName#methodName test` + +- .NET (if added) + - Build: `dotnet build` + - Test all: `dotnet test` + - Run a single test: `dotnet test --filter FullyQualifiedName~Namespace.ClassName.MethodName` + +- CI / Automation + - If you add GitHub Actions, keep workflows idempotent and cache dependencies carefully. + - Avoid secrets in workflows; read sensitive values from repository/organization secrets. + +2) Code style guidelines + +The guidance below is intentionally general and focuses on consistency, readability and safety so +agentic tools can make changes predictably across multiple languages. + +- Formatting + - Use an automated formatter for the language (Black for Python, Prettier for JS/TS, gofmt/gofmt -s for Go, + rustfmt for Rust). Commit formatted code only. + - Use an editorconfig file for basic whitespace/indentation rules when possible. + +- Imports / dependencies + - Keep imports explicit and minimal: import only what you use. + - Group imports in a logical order (language default + third-party + local project). Leave a blank line between groups. + - Don’t commit unused dependencies; remove them from lock files / manifests and run the linter. + +- Types / typing + - Prefer explicit types where the language supports them (TypeScript types, Python type hints, Go static types). + - Add types for public interfaces and complex logic; internal simple helper functions may rely on inference. + +- Naming conventions + - Use clear, descriptive names. Prefer `calculate_total`, `prepare_connection`, `user_id` style for snake_case languages. + - For camelCase languages (JS/TS): `calculateTotal`, `prepareConnection`. + - Types and classes: use PascalCase/UpperCamelCase: `UserService`, `HttpClient`. + - Constants: use UPPER_SNAKE_CASE or language-specific constant conventions. + +- Functions and modules + - Keep functions small (ideally < 40 lines) and single-responsibility. + - Prefer pure functions where possible; keep side effects explicit and isolated. + - Organize modules by feature/domain, not solely by type (avoid monolithic god-modules). + +- Error handling + - Fail fast and return/raise errors with context (message + cause) rather than swallowing them. + - Avoid logging raw errors in library code; return errors to callers and let the application layer decide logging. + - Use typed error types when the language supports it (Go error types, custom exceptions in Python/JS). + - Clean up resources with `finally`/`defer` equivalents to avoid leaks. + +- Tests + - Prefer small, deterministic unit tests. Mock external IO and network where reasonable. + - Use explicit fixtures and avoid implicit global state between tests. + - Name tests with the behavior they assert: `test_calculate_total_with_discounts` or `shouldReturn400WhenMissingField`. + +- Logging and observability + - Use structured logging where available (JSON structured logs for services). + - Avoid printing raw stack traces to stdout in production code; include them at debug level. + +- Security and secrets + - Never commit secrets, API keys, or credentials. Use environment variables and vaults. + - Validate and sanitize external input at the boundaries of the system. + +- Performance + - Measure before optimizing. Prefer clarity over micro-optimizations unless a hotspot is identified. + +3) Code review / commit guidance for agents + +- Make small, focused commits and include a one-line summary plus a short description of the why. +- When changing behavior, add or update tests that verify the new/changed behavior. +- If you reformat files automatically, include the formatter command in the commit message to make CI reproduction easy. + +4) Repo housekeeping checks (recommended for agents) + +- When adding a new language or framework, add an entry to this file with the exact commands required to build/test. +- Add CI workflows to run lint + tests on PRs and enable branch protection rules if this becomes a shared repo. + +5) Cursor / Copilot rules + +- Cursor rules: none present at `.cursor/rules/` or `.cursorrules` in this repository. +- GitHub Copilot instructions: none present at `.github/copilot-instructions.md`. + +If you add any of these files, update this document and include the exact file path and relevant sections for agents to follow. + +Quick checklist for an agent making changes +- Run local linter/formatter configured for the language before opening a PR. +- Run the test suite and the single-test command for any tests you added/changed. +- Do not add secrets to the tree; use placeholders and document required environment variables. + +Next steps (recommended) +1) Add a minimal `Makefile` or `package.json` scripts for common tasks so agents can run `make test` / `npm test`. +2) If the project will contain multiple services, add per-service README files and CI workflows. +3) Add EditorConfig + language-specific formatter configs (pyproject.toml, .prettierrc, rustfmt.toml) to lock formatting rules. + +Files referenced +- Root `README.md` +- `post_installation_script/README.md` - main script usage +- `post_installation_script_test/README.md` - testing instructions +- `.cursor/rules/` (not present) +- `.cursorrules` (not present) +- `.github/copilot-instructions.md` (not present) + +If anything in this file needs to be stricter or you want another style (for example a fully opinionated TS style), say which language or style and I will update `AGENTS.md` accordingly. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f5d17c --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# OS +.DS_Store +Thumbs.db +*~ + +# IDE +.idea/ +*.swp +*.swo +*~ +.vscode/ + +# Test containers +*.tar.gz +fonts-main/ +*.log + +# Temporary files +tmp/ +temp/ +*.tmp + +# agent specific sessions +.agents/sessions/* diff --git a/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh b/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh similarity index 84% rename from 20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh rename to post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh index 14ff8cc..dc3e447 100644 --- a/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh +++ b/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh @@ -51,13 +51,13 @@ echo " # # # - sudo apt-get update +sudo apt-get update sSuffixDate=$(date '+%Y-%m-%d_%H:%M:%S') echo -if question_answered_with_yes "#### 64 bit Mint XFCE ; Zusatzprogramme ####\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $'#### 64 bit Mint XFCE ; Zusatzprogramme ####\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "#### 64 bit Mint XFCE ####" sudo apt -y install xfce4-goodies clementine vlc htop hardinfo font-manager asunder gtkhash xfce4-panel-profiles bIsVlcInstalled=true @@ -70,7 +70,7 @@ echo echo "#### nur auf Wunsch / bei Bedarf ####" echo ### Sensoren ### -if question_answered_with_yes " ### Sensoren ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Sensoren ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### Sensoren ###" sudo apt install lm-sensors psensor sudo sensors-detect @@ -83,7 +83,7 @@ echo echo if [ "$bIsVlcInstalled" = true ]; then echo "### Kauf-DVDs abspielen ###" - if question_answered_with_yes " ### Film DVDs ###\n\tGeben Sie j oder n ein und die Eingabetaste,\n\tAbbruch mit jeder anderen Taste ..."; then + if question_answered_with_yes $' ### Film DVDs ###\n\tGeben Sie j oder n ein und die Eingabetaste,\n\tAbbruch mit jeder anderen Taste ...'; then echo "### Kauf-DVDs abspielen ###" sudo apt install libdvd-pkg sudo dpkg-reconfigure libdvd-pkg @@ -99,7 +99,7 @@ echo echo "### Schriften, falls Microsoft-Office-Dokumente weiterverwendet werden sollen oder Dokumentenaustausch mit Microsoft-Nutzern gewünscht ist ### ## frei verfügbare, alte Microsoft-Standardschriften installieren:" -if question_answered_with_yes " ### M$ Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### M$ Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### M$ Schriften ###" sudo apt install ttf-mscorefonts-installer fi @@ -107,7 +107,7 @@ fi echo echo echo " ## freie Google-Schriften als Ersatz für aktuelle MS-Standardschriften installieren:" -if question_answered_with_yes " ### Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo echo "### Google Schriften ###" @@ -117,7 +117,7 @@ if question_answered_with_yes " ### Google Schriften ###\nGeben Sie j oder n ein echo "" echo "$fGoogleSchriften nicht gefunden." echo " soll das Archiv "google-fonts.tar.gz" von Github heruntergeladen werden? Es ist ca. 1,4GB gross! " - if question_answered_with_yes " ### Download Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then + if question_answered_with_yes $' ### Download Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" echo "Connecting to Github server to download fonts..." wget "$_wgeturl" -O "$_gf.tar.gz" @@ -151,7 +151,7 @@ fi echo echo echo "#### Chromium Browser installieren:" -if question_answered_with_yes " ### Chromium ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Chromium ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### Chromium ###" sudo apt install chromium-browser sudo apt install chromium @@ -160,7 +160,7 @@ fi echo echo echo "#### Vivaldi Browser installieren:" -if question_answered_with_yes " ### Vivaldi ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Vivaldi ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### ###" echo "## nötige Zusatzpakete installieren" sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y @@ -183,7 +183,7 @@ fi echo echo echo "####Signal für Desktop (die Nutzung setzt eine Signal-Installation auf einem Android- Oder Apple-Gerät voraus!)#### " -if question_answered_with_yes " ### Signal ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Signal ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### ###" echo "## zusätzliches Repository nötig! ## NOTE: These instructions only work for 64-bit Debian-based @@ -210,7 +210,7 @@ echo echo "Achtung! Es kann vorkommen, dass die Taskleiste nach diesem Schritt verschwunden ist." echo "Ein Abmelden und Wiederanmelden des Benutzers oder ein Reboot behebt das Problem." echo -if question_answered_with_yes " ### Panel ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ..."; then +if question_answered_with_yes $' ### Panel ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then echo "### ###" echo "## Austausch der Panel-Konfigurationsdatei:" xfce4-panel-profiles load current-config.tar.bz2 @@ -231,6 +231,6 @@ echo echo "Wenn ### Google-Schriften ### installiert wurden: Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office, falls gewünscht." echo echo -if question_answered_with_yes " ### Um dieses Fenster zu schliessen, \"Enter\" drücken ###"; then +if question_answered_with_yes $' ### Um dieses Fenster zu schliessen, "Enter" drücken ###'; then exit 0 fi diff --git a/231013_nachinstallationsarbeiten_Konsole_v2.txt.sh b/post_installation_script/231013_nachinstallationsarbeiten_Konsole_v2.txt.sh similarity index 100% rename from 231013_nachinstallationsarbeiten_Konsole_v2.txt.sh rename to post_installation_script/231013_nachinstallationsarbeiten_Konsole_v2.txt.sh diff --git a/post_installation_script/README.md b/post_installation_script/README.md new file mode 100644 index 0000000..c45a9c5 --- /dev/null +++ b/post_installation_script/README.md @@ -0,0 +1,18 @@ +# Post-Installation Script + +This directory contains all files belonging to the Linux Mint XFCE post-installation script. + +## Usage + +Run the main script: + +```bash +cd post_installation_script +bash 20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh +``` + +The script is interactive and will prompt for confirmation before each installation step. + +## Testing + +See `../post_installation_script_test/README.md` for container-based testing instructions. diff --git a/post_installation_script_test/01_create_image.sh b/post_installation_script_test/01_create_image.sh new file mode 100755 index 0000000..116b0d7 --- /dev/null +++ b/post_installation_script_test/01_create_image.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Create test image from Dockerfile +docker build -t mint-script-test -f Dockerfile . diff --git a/post_installation_script_test/02_start_container_with_image.sh b/post_installation_script_test/02_start_container_with_image.sh new file mode 100755 index 0000000..20c9303 --- /dev/null +++ b/post_installation_script_test/02_start_container_with_image.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Start container with the test image (interactive shell) +docker run -it --rm \ + --cap-drop ALL --security-opt no-new-privileges --tmpfs /tmp:rw \ + -v "$(pwd)/../post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh":/workspace/script.sh:ro \ + mint-script-test diff --git a/post_installation_script_test/Dockerfile b/post_installation_script_test/Dockerfile new file mode 100644 index 0000000..771c9a3 --- /dev/null +++ b/post_installation_script_test/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:22.04 + +# Minimal image for safe simulation of apt installs. +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash wget tar curl gnupg ca-certificates apt-utils apt coreutils file procps && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# sudo wrapper: simulate apt installs and avoid making changes to the image +RUN cat > /usr/local/bin/sudo <<'EOF' +#!/bin/sh +# sudo wrapper for simulation: +# - simulate installs with `apt-get -s install ...` +# - run `apt-get update` quietly (needed so apt -s has metadata) +# - otherwise echo the command (no-op) +cmd="$1" +arg2="${2:-}" +if [ "$cmd" = "apt" ] || [ "$cmd" = "apt-get" ]; then + if [ "$arg2" = "install" ]; then + shift 2 + echo "[sudo-wrapper] simulating: apt-get -s install $@" + apt-get -s install "$@" + exit $? + elif [ "$arg2" = "update" ]; then + # do not run update at runtime (may require extra privileges); simulate instead + echo "[sudo-wrapper] simulating: apt-get update (no-op in container)" + exit 0 + else + echo "[sudo-wrapper] would run: $@" + exit 0 + fi +else + echo "[sudo-wrapper] would run: $@" + exit 0 +fi +EOF +RUN chmod +x /usr/local/bin/sudo + +ENV PATH=/usr/local/bin:$PATH + +WORKDIR /workspace +ENTRYPOINT ["/bin/bash"] diff --git a/post_installation_script_test/README.md b/post_installation_script_test/README.md new file mode 100644 index 0000000..f1df0af --- /dev/null +++ b/post_installation_script_test/README.md @@ -0,0 +1,60 @@ +# Post-Installation Script Testing + +This directory contains everything needed to test the post-installation script in a safe, isolated container environment. + +## Contents + +- `Dockerfile` - Container image definition for testing +- `01_create_image.sh` - script for creating container image locally +- `02_start_container_with_image.sh` - script for starting container from created image + +## Purpose + +Provides a reproducible testing environment that allows: + +- Running the post-installation script without affecting the host system +- Simulating `apt` installations (safe, no real package changes) +- Testing script logic, prompts, and error handling +- Validating syntax and tracing execution + +## Features + +The Dockerfile includes: + +- Ubuntu 22.04 base image +- Simulated `sudo` wrapper that runs `apt-get -s install` (simulates installs without making changes) +- Useful utilities: `bash`, `wget`, `tar`, `curl`, `gnupg`, `ca-certificates`, `file`, `procps` + +## Usage + +### Build the test image +Run the prepared shell script to build the image + +```bash +cd post_installation_script_test +sh 01_create_image.sh +``` + +### Start a container for testing +Run the prepared shell script start a new container for testing based in the +image and remove container after it is stopped. After container is started an interactive session is started into the container. + +```bash +cd post_installation_script_test +sh 02_start_container_with_image.sh +``` + + +### Test the script file in the running container +After container is started an interactive session was started in the container and the script can be started for testing + +```bash +sh script.sh +``` + +## Security Notes + +- The script is mounted read-only (`:ro` flag) to prevent container from modifying host files +- Container runs with reduced privileges (`--cap-drop ALL --security-opt no-new-privileges`) +- The `sudo` wrapper simulates apt operations, so no packages are actually installed +- Use `--tmpfs /tmp:rw` for any temporary writes inside the container From 34d6707ba31d93de4c2c126360f95afc4356b529 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 15 Feb 2026 18:18:30 +0100 Subject: [PATCH 4/6] removed apt simulation doing now real apt updates/install --- .../xfce4-panel.xml | 0 .../02_start_container_with_image.sh | 4 +- post_installation_script_test/Dockerfile | 37 ++----------------- post_installation_script_test/README.md | 13 ++++--- 4 files changed, 13 insertions(+), 41 deletions(-) rename xfce4-panel.xml => post_installation_script/xfce4-panel.xml (100%) diff --git a/xfce4-panel.xml b/post_installation_script/xfce4-panel.xml similarity index 100% rename from xfce4-panel.xml rename to post_installation_script/xfce4-panel.xml diff --git a/post_installation_script_test/02_start_container_with_image.sh b/post_installation_script_test/02_start_container_with_image.sh index 20c9303..861a518 100755 --- a/post_installation_script_test/02_start_container_with_image.sh +++ b/post_installation_script_test/02_start_container_with_image.sh @@ -2,6 +2,6 @@ # Start container with the test image (interactive shell) docker run -it --rm \ - --cap-drop ALL --security-opt no-new-privileges --tmpfs /tmp:rw \ - -v "$(pwd)/../post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh":/workspace/script.sh:ro \ + --tmpfs /tmp:rw \ + -v "$(pwd)/../post_installation_script/":/workspace/:ro \ mint-script-test diff --git a/post_installation_script_test/Dockerfile b/post_installation_script_test/Dockerfile index 771c9a3..d4908da 100644 --- a/post_installation_script_test/Dockerfile +++ b/post_installation_script_test/Dockerfile @@ -1,41 +1,12 @@ FROM ubuntu:22.04 -# Minimal image for safe simulation of apt installs. +# Install required utilities including sudo RUN apt-get update && apt-get install -y --no-install-recommends \ - bash wget tar curl gnupg ca-certificates apt-utils apt coreutils file procps && \ + bash wget tar curl gnupg ca-certificates apt-utils apt coreutils file procps sudo && \ apt-get clean && rm -rf /var/lib/apt/lists/* -# sudo wrapper: simulate apt installs and avoid making changes to the image -RUN cat > /usr/local/bin/sudo <<'EOF' -#!/bin/sh -# sudo wrapper for simulation: -# - simulate installs with `apt-get -s install ...` -# - run `apt-get update` quietly (needed so apt -s has metadata) -# - otherwise echo the command (no-op) -cmd="$1" -arg2="${2:-}" -if [ "$cmd" = "apt" ] || [ "$cmd" = "apt-get" ]; then - if [ "$arg2" = "install" ]; then - shift 2 - echo "[sudo-wrapper] simulating: apt-get -s install $@" - apt-get -s install "$@" - exit $? - elif [ "$arg2" = "update" ]; then - # do not run update at runtime (may require extra privileges); simulate instead - echo "[sudo-wrapper] simulating: apt-get update (no-op in container)" - exit 0 - else - echo "[sudo-wrapper] would run: $@" - exit 0 - fi -else - echo "[sudo-wrapper] would run: $@" - exit 0 -fi -EOF -RUN chmod +x /usr/local/bin/sudo - -ENV PATH=/usr/local/bin:$PATH +# Configure passwordless sudo for all users (needed for script) +RUN echo 'ALL ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers WORKDIR /workspace ENTRYPOINT ["/bin/bash"] diff --git a/post_installation_script_test/README.md b/post_installation_script_test/README.md index f1df0af..ff41e8b 100644 --- a/post_installation_script_test/README.md +++ b/post_installation_script_test/README.md @@ -13,7 +13,7 @@ This directory contains everything needed to test the post-installation script i Provides a reproducible testing environment that allows: - Running the post-installation script without affecting the host system -- Simulating `apt` installations (safe, no real package changes) +- Real `apt` installations (isolated in container) - Testing script logic, prompts, and error handling - Validating syntax and tracing execution @@ -22,8 +22,8 @@ Provides a reproducible testing environment that allows: The Dockerfile includes: - Ubuntu 22.04 base image -- Simulated `sudo` wrapper that runs `apt-get -s install` (simulates installs without making changes) -- Useful utilities: `bash`, `wget`, `tar`, `curl`, `gnupg`, `ca-certificates`, `file`, `procps` +- Passwordless sudo for real apt installations +- Useful utilities: `bash`, `wget`, `tar`, `curl`, `gnupg`, `ca-certificates`, `file`, `procps`, `sudo` ## Usage @@ -49,12 +49,13 @@ sh 02_start_container_with_image.sh After container is started an interactive session was started in the container and the script can be started for testing ```bash -sh script.sh +ls -al +sh .sh ``` ## Security Notes - The script is mounted read-only (`:ro` flag) to prevent container from modifying host files -- Container runs with reduced privileges (`--cap-drop ALL --security-opt no-new-privileges`) -- The `sudo` wrapper simulates apt operations, so no packages are actually installed +- All apt installations are real but isolated in the container - Use `--tmpfs /tmp:rw` for any temporary writes inside the container +- Container is automatically removed after exit (`--rm` flag) From 1b262b55d7068f94f4a2c4b5db6c41247aaf1ad2 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 15 Feb 2026 18:20:28 +0100 Subject: [PATCH 5/6] added section for agents regarding session storage --- .agents/AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index a225c4b..beac5e9 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -139,6 +139,7 @@ agentic tools can make changes predictably across multiple languages. - When adding a new language or framework, add an entry to this file with the exact commands required to build/test. - Add CI workflows to run lint + tests on PRs and enable branch protection rules if this becomes a shared repo. +- **Session storage**: Store session logs and working notes in `.agents/sessions/` folder for future reference. Use descriptive filenames (e.g., `session--.md`). 5) Cursor / Copilot rules From 1c10ae26108c391e17a075f21f814bcfd0c8ba26 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 15 Feb 2026 19:02:36 +0100 Subject: [PATCH 6/6] fixed line breaks and script exit --- ...tallationsarbeiten_LC_Esslingen_XFCE_v8.sh | 35 ++++++++++--------- post_installation_script_test/README.md | 4 ++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh b/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh index dc3e447..12ac3af 100644 --- a/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh +++ b/post_installation_script/20251212_Nachinstallationsarbeiten_LC_Esslingen_XFCE_v8.sh @@ -14,11 +14,13 @@ bIsVlcInstalled=false question_answered_with_yes() { local prompt="$1" local ans - # -r prevents backslash escapes being interpreted; -p prints the prompt - read -rp "$prompt [j/N]: " ans + # Use %b to interpret backslash escape sequences (\n, \t, etc.) + printf '%b\n Geben Sie j oder n ein und die Eingabetaste,\n Abbruch mit jeder anderen Taste ... [j/N]: ' "$prompt" + read -r ans case "$ans" in j|J|ja|y|Y) return 0 ;; - *) return 1 ;; + n|N|"") return 1 ;; + *) echo "Abbruch."; exit 1 ;; esac } @@ -33,7 +35,7 @@ echo " # Vorausgesetzt wird eine Installation von Linux Mint XFCE. # Das Skript bietet -teilweise interaktiv- die Installation von zusätzlichen Programmen an, die Linux Mint XFCE nicht standardmässig mitbringt. # -# Zu Beginn werden -ohne weitere Rückfrage- die folgenden zusätzlichen Programme installiert: +# Zu Beginn werden die folgenden zusätzlichen Programme in einem Schritt installiert: # # xfce4-goodies (zusätzliche Elemente für die Taskleiste) # xfce4-panel-profiles (Tool für die Taskleistenbearbeitung) @@ -57,7 +59,7 @@ sSuffixDate=$(date '+%Y-%m-%d_%H:%M:%S') echo -if question_answered_with_yes $'#### 64 bit Mint XFCE ; Zusatzprogramme ####\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes "#### Installiere Zusatzprogramme für 64 bit Mint XFCE? ####"; then echo "#### 64 bit Mint XFCE ####" sudo apt -y install xfce4-goodies clementine vlc htop hardinfo font-manager asunder gtkhash xfce4-panel-profiles bIsVlcInstalled=true @@ -70,7 +72,7 @@ echo echo "#### nur auf Wunsch / bei Bedarf ####" echo ### Sensoren ### -if question_answered_with_yes $' ### Sensoren ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere Sensoren? ###"; then echo "### Sensoren ###" sudo apt install lm-sensors psensor sudo sensors-detect @@ -83,7 +85,7 @@ echo echo if [ "$bIsVlcInstalled" = true ]; then echo "### Kauf-DVDs abspielen ###" - if question_answered_with_yes $' ### Film DVDs ###\n\tGeben Sie j oder n ein und die Eingabetaste,\n\tAbbruch mit jeder anderen Taste ...'; then + if question_answered_with_yes " ### Installiere Paket um Film DVDs abspielen zu können? ###"; then echo "### Kauf-DVDs abspielen ###" sudo apt install libdvd-pkg sudo dpkg-reconfigure libdvd-pkg @@ -99,7 +101,7 @@ echo echo "### Schriften, falls Microsoft-Office-Dokumente weiterverwendet werden sollen oder Dokumentenaustausch mit Microsoft-Nutzern gewünscht ist ### ## frei verfügbare, alte Microsoft-Standardschriften installieren:" -if question_answered_with_yes $' ### M$ Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere M$ Schriften? ###"; then echo "### M$ Schriften ###" sudo apt install ttf-mscorefonts-installer fi @@ -107,7 +109,7 @@ fi echo echo echo " ## freie Google-Schriften als Ersatz für aktuelle MS-Standardschriften installieren:" -if question_answered_with_yes $' ### Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere Google Schriften? ###"; then echo echo "### Google Schriften ###" @@ -117,7 +119,7 @@ if question_answered_with_yes $' ### Google Schriften ###\nGeben Sie j oder n ei echo "" echo "$fGoogleSchriften nicht gefunden." echo " soll das Archiv "google-fonts.tar.gz" von Github heruntergeladen werden? Es ist ca. 1,4GB gross! " - if question_answered_with_yes $' ### Download Google Schriften ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then + if question_answered_with_yes " ### Download Google Schriften ###"; then _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" echo "Connecting to Github server to download fonts..." wget "$_wgeturl" -O "$_gf.tar.gz" @@ -151,7 +153,7 @@ fi echo echo echo "#### Chromium Browser installieren:" -if question_answered_with_yes $' ### Chromium ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere Chromium? ###"; then echo "### Chromium ###" sudo apt install chromium-browser sudo apt install chromium @@ -160,7 +162,7 @@ fi echo echo echo "#### Vivaldi Browser installieren:" -if question_answered_with_yes $' ### Vivaldi ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere Vivaldi? ###"; then echo "### ###" echo "## nötige Zusatzpakete installieren" sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y @@ -183,7 +185,7 @@ fi echo echo echo "####Signal für Desktop (die Nutzung setzt eine Signal-Installation auf einem Android- Oder Apple-Gerät voraus!)#### " -if question_answered_with_yes $' ### Signal ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Installiere Signal? ###"; then echo "### ###" echo "## zusätzliches Repository nötig! ## NOTE: These instructions only work for 64-bit Debian-based @@ -210,7 +212,7 @@ echo echo "Achtung! Es kann vorkommen, dass die Taskleiste nach diesem Schritt verschwunden ist." echo "Ein Abmelden und Wiederanmelden des Benutzers oder ein Reboot behebt das Problem." echo -if question_answered_with_yes $' ### Panel ###\nGeben Sie j oder n ein und die Eingabetaste,\nAbbruch mit jeder anderen Taste ...'; then +if question_answered_with_yes " ### Änderungen am Panel durchführen? ###"; then echo "### ###" echo "## Austausch der Panel-Konfigurationsdatei:" xfce4-panel-profiles load current-config.tar.bz2 @@ -231,6 +233,5 @@ echo echo "Wenn ### Google-Schriften ### installiert wurden: Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office, falls gewünscht." echo echo -if question_answered_with_yes $' ### Um dieses Fenster zu schliessen, "Enter" drücken ###'; then - exit 0 -fi +read -p ' ### Um dieses Fenster zu schliessen, Enter drücken ### ' +exit 0 diff --git a/post_installation_script_test/README.md b/post_installation_script_test/README.md index ff41e8b..23d005b 100644 --- a/post_installation_script_test/README.md +++ b/post_installation_script_test/README.md @@ -46,7 +46,9 @@ sh 02_start_container_with_image.sh ### Test the script file in the running container -After container is started an interactive session was started in the container and the script can be started for testing +After container is started an interactive session was started in the container and the script can be started for testing. +If script is changed on the host it just needs to be restarted in the container to reflect the changes. +This works because to folder is mounted into the container. ```bash ls -al