kopia lustrzana https://github.com/km4ack/pi-build
update
rodzic
5b7126e120
commit
0b1d1f79c3
66
update
66
update
|
@ -117,9 +117,43 @@ clear
|
||||||
#####################################
|
#####################################
|
||||||
# Patch Check
|
# Patch Check
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
|
#This check first looks at the README.md file to see if the PATCH var is YES.
|
||||||
|
#If PATCH=YES, then it looks to see if the patches that are available have
|
||||||
|
#been applied previously. If so, it skips the patch screen. If not, it gives
|
||||||
|
#the user an option to install the patch(es).
|
||||||
|
|
||||||
PATCHCHECK=$(curl -s https://raw.githubusercontent.com/km4ack/pi-build/dev/patch/README.md | grep PATCH= | sed 's/PATCH=//')
|
PATCHCHECK=$(curl -s https://raw.githubusercontent.com/km4ack/pi-build/dev/patch/README.md | grep PATCH= | sed 's/PATCH=//')
|
||||||
|
|
||||||
if [ ${PATCHCHECK} = "YES" ]; then
|
if [ ${PATCHCHECK} = "YES" ]; then
|
||||||
|
#Setup temp directory for BAP patches and download patches
|
||||||
|
echo "##########################################################"
|
||||||
|
echo "#Checking for available patches that haven't been applied#"
|
||||||
|
echo "##########################################################"
|
||||||
|
cd /run/user/$UID
|
||||||
|
git init pi-build
|
||||||
|
cd pi-build
|
||||||
|
git remote add -f origin https://github.com/km4ack/pi-build.git
|
||||||
|
git config core.sparseCheckout true
|
||||||
|
echo "/patch" >> .git/info/sparse-checkout
|
||||||
|
git pull origin dev
|
||||||
|
|
||||||
|
FILES=$(ls -I README.md /run/user/$UID/pi-build/patch)
|
||||||
|
|
||||||
|
#check if available patches have already been applied to BAP
|
||||||
|
for i in $FILES; do
|
||||||
|
|
||||||
|
NAME=$(grep PATCHNAME= /run/user/$UID/pi-build/patch/$i | sed 's/PATCHNAME=//')
|
||||||
|
RB=$(grep $NAME $HOME/.config/patch)
|
||||||
|
if [ -z $RB ]; then
|
||||||
|
echo "$NAME" >> /run/user/$UID/avail-patch.txt
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
#end check
|
||||||
|
|
||||||
|
if [ -f /run/user/$UID/avail-patch.txt ]; then
|
||||||
|
rm /run/user/$UID/avail-patch.txt
|
||||||
|
|
||||||
cat <<EOF >${MYPATH}/patch.txt
|
cat <<EOF >${MYPATH}/patch.txt
|
||||||
One or more patch scripts are currently
|
One or more patch scripts are currently
|
||||||
available for Build a Pi. Full description
|
available for Build a Pi. Full description
|
||||||
|
@ -138,22 +172,28 @@ INTRO=$(yad --width=650 --height=300 --text-align=center --center --title="Build
|
||||||
>/dev/null 2>&1)
|
>/dev/null 2>&1)
|
||||||
BUT=$?
|
BUT=$?
|
||||||
|
|
||||||
if [ ${BUT} = 252 ]; then
|
if [ ${BUT} = 252 ]; then
|
||||||
rm ${MYPATH}/patch.txt
|
echo "Button ${BUT} pressed"
|
||||||
exit
|
rm ${MYPATH}/patch.txt
|
||||||
elif [ ${BUT} = 1 ]; then
|
rm -rf /run/user/$UID/pi-build
|
||||||
rm ${MYPATH}/patch.txt
|
exit
|
||||||
lxterminal -e bash $HOME/pi-build/patch-menu && exit
|
elif [ ${BUT} = 1 ]; then
|
||||||
elif [ ${BUT} = 2 ]; then
|
echo "Button ${BUT} pressed"
|
||||||
rm ${MYPATH}/patch.txt
|
rm ${MYPATH}/patch.txt
|
||||||
echo "user declined patch updates
|
lxterminal -e bash $HOME/pi-build/patch-menu && exit
|
||||||
continuing with Build a Pi update"
|
elif [ ${BUT} = 2 ]; then
|
||||||
fi
|
echo "Button ${BUT} pressed"
|
||||||
|
rm ${MYPATH}/patch.txt
|
||||||
|
echo "user declined patch updates continuing with Build a Pi update"
|
||||||
|
rm -rf /run/user/$UID/pi-build
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rm -rf /run/user/$UID/pi-build
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Scan system for updated applications
|
#Scan system for updated applications
|
||||||
yad --width=550 --height=250 --text-align=center --center --title="Update" \
|
yad --width=550 --height=250 --text-align=center --center --title="Update" \
|
||||||
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
|
--image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
|
||||||
|
|
Ładowanie…
Reference in New Issue