diff --git a/raspi-install.sh b/raspi-install.sh index 4496ca6..e6ff515 100755 --- a/raspi-install.sh +++ b/raspi-install.sh @@ -25,6 +25,7 @@ then rimage="raspios_armhf" else rimage="raspios_full_armhf" +attribut="-f" fi #rimage ="raspios_lite_armhf" #rimage="raspios_full_armhf" @@ -34,14 +35,14 @@ cd "$HOME/Downloads" || exit 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) -wget -c "$pathr""$rname" -O raspi.zip +wget -c "$pathr""$rname" -O "raspi$attribut".zip #echo Test kompletter Pfad :: "$pathr""$rname" shaname=$(curl --silent "$pathr" | grep -o -E -w "$datum-[[:lower:]-]*\.zip\.sha256" | head -1) #echo Test kompletter sha256-Pfad :: $pathr$shaname -wget "$pathr""$shaname" -O raspi.sha256 +wget "$pathr""$shaname" -O raspi"$attribut".sha256 echo "Bitte ein paar Sekunden warten. Der Hash wird erzeugt." -sha1=$(shasum -a 256 raspi.zip | grep -o -P "[0-9a-z]{40,}") -sha2=$( grep -o -P "[0-9a-z]{40,}" < raspi.sha256 ) +sha1=$(shasum -a 256 raspi"$attribut".zip | grep -o -P "[0-9a-z]{40,}") +sha2=$( grep -o -P "[0-9a-z]{40,}" < raspi"$attribut".sha256 ) sleep 1 echo Prüfsumme aus Download "$sha1" echo Prüfsumme von Webseite "$sha2" @@ -65,11 +66,11 @@ mapfile -t laufwerke1 < <(lsblk -l -o Name | grep -E -v "[0-9]" | grep -E "sd[a- mapfile -t laufwerke2 < <({ printf "%s\n" "${laufwerke[@]}" | sort -u; printf "%s\n" "${laufwerke1[@]}" "${laufwerke[@]}"; } | sort | uniq -u) zahl_laufwerke="${#laufwerke2[@]}" -echo neue Lafwerke "$zahl_laufwerke" +echo neu erkannte Laufwerke "$zahl_laufwerke" 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" ;sleep 5; exit +echo "Es kann nicht geschrieben werden. Es wurden mehr oder weniger als 1 SD-Karte erkannt" ; exit fi else exit @@ -80,7 +81,7 @@ echo Ich bin mir SICHER und will auf SD-Karte schreiben : /dev/"${laufwerke2[0]} read -r endgueltigja if [ "$endgueltigja" == "y" ]; then # das hier aktivieren --TOTENKOPF--- zum Schreiben -#unzip -p raspi.zip | dd of=/dev/${laufwerke2[0]} bs=4M conv=fsync status=progress +#unzip -p raspi"attribut".zip | dd of=/dev/${laufwerke2[0]} bs=4M conv=fsync status=progress echo "Tatatatah ! fertig" else exit