From 2429c33f6f16f4e991d8871adab0dd23f3db6de5 Mon Sep 17 00:00:00 2001 From: Micheal Espinola Date: Wed, 19 Apr 2023 00:34:41 -0700 Subject: [PATCH] v4.3.0 1. Added automatic logging features (output .log as well as a .debug file) 2. Simplified Synology model name scrape --- syno.plexupdate.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/syno.plexupdate.sh b/syno.plexupdate.sh index 3600d4d..950be72 100755 --- a/syno.plexupdate.sh +++ b/syno.plexupdate.sh @@ -12,8 +12,15 @@ # Example Synology DSM Scheduled Task type 'user-defined script': # bash /volume1/homes/admin/scripts/bash/plex/syno.plexupdate/syno.plexupdate.sh +# Redirect stdout to tee in order to duplicate the output to the terminal as well as a .log file +# Do this while redirecting stderr/debug to a .debug file +exec > >(tee "$0.log") 2>"$0.debug" + +# Enable debug output +set -x + # SCRIPT VERSION -SPUScrpVer=4.2.0 +SPUScrpVer=4.3.0 MinDSMVers=7.0 # PRINT OUR GLORIOUS HEADER BECAUSE WE ARE FULL OF OURSELVES printf "\n" @@ -149,7 +156,7 @@ fi printf "\n" # SCRAPE SYNOLOGY HARDWARE MODEL -SynoHModel=$(cat /proc/sys/kernel/syno_hw_version) +SynoHModel=$(< /proc/sys/kernel/syno_hw_version) # SCRAPE SYNOLOGY CPU ARCHITECTURE FAMILY ArchFamily=$(uname --machine)