kopia lustrzana https://github.com/km4ack/pi-build
add gps by id
rodzic
8b884a6beb
commit
3eef006f56
38
build-a-pi
38
build-a-pi
|
@ -176,7 +176,9 @@ echo "$i" >> $BASE
|
|||
done
|
||||
fi
|
||||
|
||||
#check if hotspot is chosen for install & get info if needed
|
||||
#############################################################
|
||||
#check if hotspot is chosen for install & get info if needed#
|
||||
#############################################################
|
||||
HS=$(cat $BASE | grep HOTSPOT)
|
||||
if [ -n "$HS" ]; then
|
||||
HSINFO(){
|
||||
|
@ -238,6 +240,40 @@ fi
|
|||
echo "SHACKSSID=$SHACKSSID" >> $CONFIG
|
||||
echo "SHACKPASS=\"$SHACKPASS\"" >> $CONFIG
|
||||
echo "HSPASS=\"$HSPASS\"" >> $CONFIG
|
||||
###################################
|
||||
#CHECK IF GPS IS CHOSEN TO INSTALL#
|
||||
###################################
|
||||
GPSINSTALL=$(cat $BASE | grep GPS)
|
||||
if [ -n "$GPSINSTALL ]; then
|
||||
USB=$(ls /dev/serial/by-id)
|
||||
USB=$(echo $USB | sed "s/\s/|/g")
|
||||
|
||||
yad --center --height="300" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
|
||||
--image $LOGO --window-icon=$LOGO --image-on-top \
|
||||
--text="\r\r\r\r\r<b><big>Connect your GPS to the pi</big></b>" \
|
||||
--button="Exit":1 \
|
||||
--button="Continue":2
|
||||
|
||||
BUT=$?
|
||||
if [ $BUT = 1 ] || [ $BUT = 252 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
GPS=$(yad --center --height="600" --width="300" --form --separator="|" --item-separator="|" --title="GPS" \
|
||||
--image $LOGO --window-icon=$LOGO --image-on-top \
|
||||
--text="Choose Your GPS" \
|
||||
--field="GPS":CB "$USB")
|
||||
BUT=$?
|
||||
if [ $BUT = 252 ] || [ $BUT = 1 ]; then
|
||||
echo exiting
|
||||
exit
|
||||
fi
|
||||
|
||||
GPS=$(echo $GPS | awk -F "|" '{print $1}')
|
||||
GPS=/dev/serial/by-id/$GPS
|
||||
echo "GPS=$GPS" >> $CONFIG
|
||||
fi
|
||||
|
||||
#####################################
|
||||
# FLSUITE
|
||||
|
|
Ładowanie…
Reference in New Issue