From 0ccbe9c4c2b53f67f4ebc0ecfd74f6bd3df5ef69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=B6hn?= Date: Tue, 24 Jan 2023 02:22:57 +0100 Subject: [PATCH 1/6] =?UTF-8?q?curl=20URL=20gequotet.=20Alles=20f=C3=BCr?= =?UTF-8?q?=20Shellcheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- raspi-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raspi-install.sh b/raspi-install.sh index bed6b16..39f818f 100755 --- a/raspi-install.sh +++ b/raspi-install.sh @@ -51,7 +51,7 @@ fi cd "$HOME/Downloads" || echo"Downloads Ordner nicht vorhanden" -dirr=$(curl --silent https://downloads.raspberrypi.org/$rimage/images/ | grep -o -E "$rimage-$datum" | tail -1 ) +dirr=$(curl --silent "https://downloads.raspberrypi.org/$rimage/images/" | grep -o -E "$rimage-$datum" | tail -1 ) pathr="https://downloads.raspberrypi.org/$rimage/images/$dirr/" #rname=$(curl --silent "$pathr" | grep -o -E -w "$datum-[[:lower:]-]*\.zip" | head -1) #rname=$(curl --silent "$pathr" | grep -o -E "$datum-[[:alnum:]-]*\.xz" | head -1) From b15e329dbe18a4f501fc228dd7f56343df9e95d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=B6hn?= Date: Tue, 24 Jan 2023 02:25:42 +0100 Subject: [PATCH 2/6] nee version mit v3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1db445a..fdc4761 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,6 @@ jobs: name: Shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master From 18a6f40626b52894f765eccaffabf3b61b3b5a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=B6hn?= Date: Mon, 15 May 2023 10:27:41 +0200 Subject: [PATCH 3/6] typo .\ --- raspi-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raspi-install.sh b/raspi-install.sh index 39f818f..0c5f946 100755 --- a/raspi-install.sh +++ b/raspi-install.sh @@ -55,7 +55,7 @@ dirr=$(curl --silent "https://downloads.raspberrypi.org/$rimage/images/" | grep pathr="https://downloads.raspberrypi.org/$rimage/images/$dirr/" #rname=$(curl --silent "$pathr" | grep -o -E -w "$datum-[[:lower:]-]*\.zip" | head -1) #rname=$(curl --silent "$pathr" | grep -o -E "$datum-[[:alnum:]-]*\.xz" | head -1) -rname=$(curl --silent "$pathr" | grep -o -E "$datum-[[:alnum:]-]*\.img.\xz"|tail -1) +rname=$(curl --silent "$pathr" | grep -o -E "$datum-[[:alnum:]-]*\.img\.xz"|tail -1) wget -c "$pathr""$rname" -O "raspi$attribut".xz #echo Test kompletter Pfad :: "$pathr""$rname" From def511e24414db98c7aa6fe3a8f705a266803e5d Mon Sep 17 00:00:00 2001 From: Stefan Hoehn Date: Sat, 14 Feb 2026 17:09:56 +0100 Subject: [PATCH 5/6] Dietpi muss noch getestet werden --- dietpi-install.sh | 119 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 dietpi-install.sh diff --git a/dietpi-install.sh b/dietpi-install.sh new file mode 100755 index 0000000..994f75b --- /dev/null +++ b/dietpi-install.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# gemacht von Stefan Höhn +#https://github.com/dewomser/Raspi-auto-downloader +#ACHTUNG : Zeile 106-112 Beachten ! +attribut=$1 +datum="[0-9]{4}-[0-9]{2}-[0-9]{2}" +url="https://dietpi.com/downloads/images/" +if [[ "$attribut" = "-h" ]] +then +echo " +Aufruf dietpi-install.sh [OPTION] + +Option Bedeutung +-1 dietpi für Raspberry v1 ARMv6 +-2 dietpi für Raspberry v2 ARNv7 +-234 dietpi für Raspberry v2-4 ARMv8 +-h Diese Hilfe +-5 dietpi für Raspberrx v5 ARMv8 + +" && exit +elif [[ "$attribut" = "-1" ]] +then +rimage="DietPi_RPi1-ARMv6-Trixie" +elif [[ "$attribut" = "-2" ]] +then +rimage="DietPi_RPi2-ARMv7-Trixie" + +elif [[ "$attribut" = "-234" ]] +then +rimage="DietPi_RPi234-ARM8-Trixie" + +elif [[ "$attribut" = "-5" ]] +then +rimage="DietPi_RPi5-ARMv8-Trixie" + +else +echo "Kein Pi-Image ausgewählt. \"raspi-install.sh -h \" für Hilfe!" && exit +fi + + +cd "$HOME/Downloads" || echo"Downloads Ordner nicht vorhanden" + +#https://dietpi.com/downloads/images/DietPi_RPi2-ARMv7-Trixie.img.xz + +pathr="$url$rimage.img.xz" +pathrs="$pathr.sha256" + +# -c +wget -c "$pathr" -O "$rimage.img.xz" +wget "$pathrs" -O "$rimage.img.xz.sha256" +echo "Bitte ein paar Sekunden warten. Der Hash wird erzeugt." +sha1=$(shasum -a 256 "$rimage.img.xz") +sha2=$(cat "$rimage.img.xz.sha256") +sleep 1 +echo Prüfsumme aus Download "$sha1" +echo Prüfsumme von Webseite "$sha2" + +if [ "$sha1" == "$sha2" ]; then +echo "Prüfsumme stimmt." +echo "-----------------" +echo "SD-Karte auf die geschrieben werden soll ENTFERNEN !" \"y\" +read -r input +if [ "$input" == "y" ]; then +mapfile -t laufwerke < <(lsblk -l -o Name | grep -E "^sd[a-z]*$") +laufwerke[0]="lolo" +laufwerke1[0]="lolo" +else +exit +fi + +echo Es gibt diese seriellen Blockdevices "${laufwerke[*]}" +echo "SD-Karte auf die geschrieben werden soll EINSCHIEBEN !" \"y\" +read -r input +if [ "$input" == "y" ]; then +mapfile -t laufwerke1 < <(lsblk -l -o Name |grep -E "^sd[a-z]*$") +echo "${laufwerke1[0]}" +mapfile -t laufwerke2 < <({ printf "%s\n" "${laufwerke[@]}" | sort -u; printf "%s\n" "${laufwerke1[@]}" "${laufwerke[@]}"; } | sort | uniq -u) +zahl_laufwerke="${#laufwerke2[@]}" + + +echo neu erkannte Es gibt jetzt dieses neue serielle Blockdevice: "${laufwerke2[@]}" +echo Laufwerke ${#laufwerke2[@]} + +echo lwo:"${laufwerke2[0]}" +echo lw1:"${laufwerke2[1]}" + + +if [ "$zahl_laufwerke" -eq 1 ]; then +echo Es gibt jetzt dieses neue serielle Blockdevice: "${laufwerke2[0]}" +else +echo "Es kann nicht geschrieben werden. Es wurden mehr oder weniger als 1 SD-Karte erkannt" ; exit +fi +else +exit +fi + +echo Ich bin mir SICHER und will auf SD-Karte schreiben : /dev/"${laufwerke2[0]}" \"y\" oder \"n\" + +read -r endgueltigja +if [ "$endgueltigja" == "y" ]; then + +# Wenn die Karte nur als root gemountet werden kann, muss dd durch sudo dd ersetzt werden. umount -> sudo umount +## sudo ddd – is now on +# Alternative für Ubuntu: +# echo 'KERNEL=="sd*", SUBSYSTEMS=="usb", MODE="0666"' | sudo tee /etc/udev/rules.d/99-usb-storage.rules +# Quelle : https://askubuntu.com/questions/828545/using-dd-without-sudo + +# Wenn die nächsten 3 Zeilen aktiviert sind: "don't blame me!" +#umount /dev/"${laufwerke2[0]}"[0-9] > /dev/null 2>&1 +xz --keep --decompress dietpi"$attribut".xz +sudo dd if=raspi"$attribut" of=/dev/"${laufwerke2[0]}" bs=4M conv=fsync status=progress || echo "Es gibt Probleme mit Schreibrechten.Ab Zeile 105 gibts Hilfe" +echo "Tatatatah ! fertig" +#umount /dev/"${laufwerke2[0]}"[0-9] > /dev/null 2>&1 +else +exit +fi +else +echo "Achtung,Prüfsumme stimmt nicht überein !" +fi From e049be0cf6bd9e94892db5e8b810417e20d9ff42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=B6hn?= Date: Sat, 14 Feb 2026 17:19:09 +0100 Subject: [PATCH 6/6] Comment out date regex assignment Comment out the date regex assignment in the script. --- dietpi-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi-install.sh b/dietpi-install.sh index 994f75b..f346d83 100755 --- a/dietpi-install.sh +++ b/dietpi-install.sh @@ -3,7 +3,7 @@ #https://github.com/dewomser/Raspi-auto-downloader #ACHTUNG : Zeile 106-112 Beachten ! attribut=$1 -datum="[0-9]{4}-[0-9]{2}-[0-9]{2}" +# datum="[0-9]{4}-[0-9]{2}-[0-9]{2}" url="https://dietpi.com/downloads/images/" if [[ "$attribut" = "-h" ]] then