kopia lustrzana https://github.com/km4ack/pi-build
				
				
				
			add os version check
							rodzic
							
								
									2cf1a46b10
								
							
						
					
					
						commit
						3ad8187679
					
				
							
								
								
									
										42
									
								
								update
								
								
								
								
							
							
						
						
									
										42
									
								
								update
								
								
								
								
							| 
						 | 
				
			
			@ -45,6 +45,48 @@ FINISH() {
 | 
			
		|||
 | 
			
		||||
trap FINISH EXIT
 | 
			
		||||
 | 
			
		||||
#####################################
 | 
			
		||||
#	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
 | 
			
		||||
#####################################
 | 
			
		||||
 | 
			
		||||
#remove temp dir if exist
 | 
			
		||||
#fix issue 108 https://github.com/km4ack/pi-build/issues/108
 | 
			
		||||
#Thanks to N5RKS for finding the bug
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue