Skip to content

Commit

Permalink
Support for multiple patch urls
Browse files Browse the repository at this point in the history
  • Loading branch information
WXbet committed Dec 30, 2023
1 parent cab2e3a commit 80e1516
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
29 changes: 21 additions & 8 deletions support/functions/_patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,29 @@ _get_patch(){
printf $C
ologo
printf $WH;
[ -f $PATCHNAME ] && printf "$Y $PATCHNAME $txt_found\n $txt_delete $P$PATCHNAME" && rm -f $PATCHNAME
printf $W"\n $txt_load $PATCHNAME"

if [[ `wget -S --spider $PATCHURL 2>&1 | grep 'HTTP/1.1 200 OK'` ]]
if [ -f patch.url.template -a ! -f patch.url ]
then
wget -q -O$PATCHNAME $PATCHURL
[ -f $PATCHNAME ] && printf $G" ok$W\n\n"
else
printf $R"\n\n $PATCHURL\n\n >> $txt_not_found <<$W\n\n"
printf "${Y}To load custom patches,\nyou have to rename the file ${P}patch.url.template${Y} to ${G}patch.url${Y}\nand adjust accordingly.${W}\n\n"
exit
fi
[ ! -z "$PATCHCOUNT" ] && loop="$(eval echo "{1..$PATCHCOUNT}")"
for c in '' $loop; do
DP="PATCHNAME$c"; PATCHNAME=${!DP}
DU="PATCHURL$c"; PATCHURL=${!DU}
if [ ! -z "$PATCHNAME" -a ! -z "$PATCHURL" ]
then
[ -f $PATCHNAME ] && printf "$Y $PATCHNAME $txt_found\n $txt_delete $P$PATCHNAME" && rm -f $PATCHNAME
printf $W"\n $txt_load $PATCHNAME"

if [[ `wget -S --spider $PATCHURL 2>&1 | grep 'HTTP/1.1 200 OK'` ]]
then
wget -q -O$PATCHNAME $PATCHURL
[ -f $PATCHNAME ] && printf $G" ok$W\n\n"
else
printf $R"\n\n $PATCHURL\n\n >> $txt_not_found <<$W\n\n"
fi
fi
done
}

_streamboard_patch(){
Expand Down
Empty file added support/patches/no.patch
Empty file.
9 changes: 9 additions & 0 deletions support/patches/patch.url.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PATCHURL="https://raw.githubusercontent.com/gorgone/s3_releases/master/support/patches/no.patch"
PATCHNAME="no.patch"
#PATCHCOUNT=3
#PATCHURL1="https://raw.githubusercontent.com/gorgone/s3_releases/master/support/patches/no.patch"
#PATCHNAME1="no1.patch"
#PATCHURL2="https://raw.githubusercontent.com/gorgone/s3_releases/master/support/patches/no.patch"
#PATCHNAME2="no2.patch"
#PATCHURL3="https://raw.githubusercontent.com/gorgone/s3_releases/master/support/patches/no.patch"
#PATCHNAME3="no3.patch"

0 comments on commit 80e1516

Please sign in to comment.