kopia lustrzana https://github.com/km4ack/pi-build
add os version check
rodzic
b1ce4793c3
commit
2cf1a46b10
42
build-a-pi
42
build-a-pi
|
@ -57,6 +57,48 @@ EOF
|
|||
exit 0
|
||||
fi
|
||||
|
||||
#####################################
|
||||
# Old OS Check
|
||||
#####################################
|
||||
V_ID=$(grep VERSION_ID /etc/os-release | sed 's/VERSION_ID="//;s/"//')
|
||||
|
||||
if [ "$V_ID" -le 10 ]; then
|
||||
NOTICEPATH=/run/user/$UID
|
||||
|
||||
cat <<EOF >${NOTICEPATH}/intro.txt
|
||||
Build a Pi 3.2.0 and later does not support
|
||||
RaspiOS Buster or earlier versions of RaspiOS.
|
||||
You should consider upgrading to RaspiOS 11
|
||||
(Bullseye). By clicking ok you will be moved
|
||||
to the last version of Build a Pi (3.1.4) that
|
||||
supports Pi OS Buster. Please note there are
|
||||
no plans to update Build a Pi for Buster going
|
||||
forward. In other words, you are on your own
|
||||
if it is broke and you are still running Pi OS
|
||||
10 (Buster).
|
||||
|
||||
EOF
|
||||
|
||||
INTRO=$(yad --width=600 --height=300 --text-align=center --center --title="Out of Date OS Detected!" --show-uri \
|
||||
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
|
||||
--text-info \
|
||||
--button="OK":1 <${NOTICEPATH}/intro.txt \
|
||||
--button="Exit":2 \
|
||||
>/dev/null 2>&1)
|
||||
BUT=$?
|
||||
echo $BUT
|
||||
if [ $BUT = 2 ] || [ $BUT = 252 ]; then
|
||||
exit
|
||||
fi
|
||||
rm ${NOTICEPATH}/intro.txt
|
||||
cd $HOME/pi-build
|
||||
git checkout buster
|
||||
bash build-a-pi & exit
|
||||
|
||||
#####################################
|
||||
# end Old OS Check
|
||||
#####################################
|
||||
|
||||
#install YAD & jq as needed
|
||||
clear
|
||||
echo
|
||||
|
|
Ładowanie…
Reference in New Issue