Skip to content

Commit

Permalink
Force logging output of script update process
Browse files Browse the repository at this point in the history
1. Make script update commands verbose
2. Force script update commands to display execution with stream redirections
  • Loading branch information
michealespinola authored Apr 30, 2023
1 parent 4283f97 commit 94a29ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions syno.plexupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exec > >(tee "$SrceFllPth.log") 2>"$SrceFllPth.debug"
set -x

# SCRIPT VERSION
SPUScrpVer=4.3.4
SPUScrpVer=4.3.5
MinDSMVers=7.0
# PRINT OUR GLORIOUS HEADER BECAUSE WE ARE FULL OF OURSELVES
printf "\n"
Expand Down Expand Up @@ -111,14 +111,14 @@ if [ "$?" -eq "0" ]; then
printf "\n"
printf "%s\n" "INSTALLING NEW SCRIPT:"
printf "%s\n" "----------------------------------------"
/bin/wget "$SPUSDwnUrl" -nv -O "$SrceFolder/Archive/Scripts/$SrceFileNm"
/bin/wget -nv "$SPUSDwnUrl" -O "$SrceFolder/Archive/Scripts/$SrceFileNm" 2>&1
if [ "$?" -eq "0" ]; then
# MAKE A COPY FOR UPGRADE COMPARISON BECAUSE WE ARE GOING TO MOVE NOT COPY THE NEW FILE
cp -f "$SrceFolder/Archive/Scripts/$SrceFileNm" "$SrceFolder/Archive/Scripts/$SrceFileNm.cmp"
cp -f -v "$SrceFolder/Archive/Scripts/$SrceFileNm" "$SrceFolder/Archive/Scripts/$SrceFileNm.cmp" 2>&1
# MOVE-OVERWRITE INSTEAD OF COPY-OVERWRITE TO NOT CORRUPT RUNNING IN-MEMORY VERSION OF SCRIPT
mv -f "$SrceFolder/Archive/Scripts/$SrceFileNm" "$SrceFolder/$SrceFileNm"
mv -f -v "$SrceFolder/Archive/Scripts/$SrceFileNm" "$SrceFolder/$SrceFileNm" 2>&1
printf "%s\n" "----------------------------------------"
cmp -s "$SrceFolder/Archive/Scripts/$SrceFileNm.cmp" "$SrceFolder/$SrceFileNm"
cmp "$SrceFolder/Archive/Scripts/$SrceFileNm.cmp" "$SrceFolder/$SrceFileNm" 2>&1
if [ "$?" -eq "0" ]; then
printf ' %s\n' "* Script update succeeded!"
/usr/syno/bin/synonotify PKGHasUpgrade '{"%PKG_HAS_UPDATE%": "Syno.Plex Update\n\nSelf-Update completed successfully"}'
Expand Down

0 comments on commit 94a29ea

Please sign in to comment.