fixed problem with unexpected operator after pressing 'j'

This commit is contained in:
2026-02-14 18:52:13 +01:00
parent fc1554cee9
commit 3c6856d68b
@@ -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,10 +57,7 @@ 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
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
@@ -61,26 +70,20 @@ 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
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"
echo "## im Anschluss \"psensor\" konfigurieren im XFCE-Applet in der Taskleiste"
fi
echo
echo
if $bIsVlcInstalled; then
if [ "$bIsVlcInstalled" = true ]; 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
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
@@ -96,10 +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:"
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
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,10 +107,7 @@ 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
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 ###"
@@ -120,24 +117,20 @@ 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
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
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
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."
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."
@@ -158,23 +151,16 @@ 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
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
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
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
@@ -197,10 +183,7 @@ 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
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
@@ -227,10 +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
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
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
@@ -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