- Fixes for some variables

- Test for existence of file/dir instead of ls|grep
pull/118/head
jangliss 2020-07-16 09:27:13 -05:00 zatwierdzone przez Patrick Naubert
rodzic 5385b12222
commit cd981b0986
1 zmienionych plików z 12 dodań i 12 usunięć

24
update
Wyświetl plik

@ -12,7 +12,7 @@
# # # #
################################################################## ##################################################################
MYPATH=$HOME/pi-build MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BASE=$MYPATH/base.txt BASE=$MYPATH/base.txt
FUNCTIONS=$MYPATH/functions FUNCTIONS=$MYPATH/functions
ADDITIONAL=$MYPATH/additional.txt ADDITIONAL=$MYPATH/additional.txt
@ -21,7 +21,7 @@ FLSUITE=$MYPATH/flsuite.txt
CONFIG=$MYPATH/config CONFIG=$MYPATH/config
LOGO=$MYPATH/logo.png LOGO=$MYPATH/logo.png
TEMPCRON=$MYPATH/cron.tmp TEMPCRON=$MYPATH/cron.tmp
VERSION=$(cat $MYPATH/changelog | grep version= | sed 's/version=//') VERSION=$(grep "version=" $MYPATH/changelog | sed 's/version=//')
FINISH(){ FINISH(){
if [ -f "$BASE" ]; then if [ -f "$BASE" ]; then
@ -60,7 +60,7 @@ mkdir -p $HOME/.config/autostart
#Check for BAP updates #Check for BAP updates
#Check for build a pi updates #Check for build a pi updates
echo "Checking for Build a Pi updates" echo "Checking for Build a Pi updates"
CURRENT=$(cat $MYPATH/changelog | head -1 | sed s'/version=//') CURRENT=$(head -1 $MYPATH/changelog | sed s'/version=//')
LATEST=$(curl -s https://raw.githubusercontent.com/km4ack/pi-build/master/changelog | head -1 | sed 's/version=//') LATEST=$(curl -s https://raw.githubusercontent.com/km4ack/pi-build/master/changelog | head -1 | sed 's/version=//')
@ -85,7 +85,7 @@ echo $BUT
elif [ $BUT = 2 ]; then elif [ $BUT = 2 ]; then
echo "Updating Build a Pi to $LATEST" echo "Updating Build a Pi to $LATEST"
mv $MYPATH/config $HOME/Documents/config.bap mv $MYPATH/config $HOME/Documents/config.bap
rm -rf $HOME/pi-build rm -rf $MYPATH
cd ~ cd ~
git clone https://github.com/km4ack/pi-build.git git clone https://github.com/km4ack/pi-build.git
mv $HOME/Documents/config.bap $MYPATH/config mv $HOME/Documents/config.bap $MYPATH/config
@ -123,8 +123,8 @@ CHECK(){
#----------------------------------------------------# #----------------------------------------------------#
# Hotspot # Hotspot
#----------------------------------------------------# #----------------------------------------------------#
HOTSPOT=$(ls /usr/bin/ | grep autohotspotN) HOTSPOT="/usr/bin/autohotspotN"
if [ -z "$HOTSPOT" ]; then if [ ! -f "$HOTSPOT" ]; then
HOTSPOT="Not Installed" HOTSPOT="Not Installed"
else else
HOTSPOT="Installed" HOTSPOT="Installed"
@ -447,8 +447,8 @@ fi
#----------------------------------------------------# #----------------------------------------------------#
# XASTIR # XASTIR
#----------------------------------------------------# #----------------------------------------------------#
XA=$(ls /usr/bin/ | grep xastir) XA="/usr/bin/xastir"
if [ -z "$XA" ]; then if [ ! -f "$XA" ]; then
XASTIR="Not Installed" XASTIR="Not Installed"
else else
XASTIR="Installed" XASTIR="Installed"
@ -457,8 +457,8 @@ fi
#----------------------------------------------------# #----------------------------------------------------#
# YAAC # YAAC
#----------------------------------------------------# #----------------------------------------------------#
YAAC=$(ls $HOME | grep YAAC) YAAC="$HOME/YAAC"
if [ -z "$YAAC" ]; then if [ ! -d "$YAAC" ]; then
YAAC="Not Installed" YAAC="Not Installed"
else else
YAAC="Installed" YAAC="Installed"
@ -485,8 +485,8 @@ fi
#----------------------------------------------------# #----------------------------------------------------#
# GRIDTRACKER # GRIDTRACKER
#----------------------------------------------------# #----------------------------------------------------#
GT=$(ls $HOME | grep GridTracker) GT="$HOME/GridTracker"
if [ -z "$GT" ]; then if [ ! -d "$GT" ]; then
GRIDTRACK="Not Installed" GRIDTRACK="Not Installed"
else else
GRIDTRACK="Installed" GRIDTRACK="Installed"