From 8dda798664a8553ba58f24b936355039e223b3fc Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Tue, 21 Jul 2020 13:53:55 -0400 Subject: [PATCH] Make cron logic in installer more readable --- extras/installer.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extras/installer.sh b/extras/installer.sh index 7105553..c05b35a 100755 --- a/extras/installer.sh +++ b/extras/installer.sh @@ -236,7 +236,11 @@ configure_cron() { return 1 fi - [ -f "$CONFIGCRON" ] && source "$CONFIGCRON" + if [ -f "$CONFIGCRON" ]; then + #this is redundant since null is evaluated as yes anyway, but including for readability + CRON=yes + source "$CONFIGCRON" + fi echo echo -n "Would you like to set up automatic daily updates for Plex? " @@ -354,7 +358,7 @@ if yesno; then if wget --show-progress -V &> /dev/null; then PROGRESS_OPT="-P" fi - if [ "$AUTOINSTALL" == "yes" ] || [ -f "$CONFIGCRON" ]; then + if [ "$AUTOINSTALL" == "yes" ] || [ "$CRON" == "yes" ]; then sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE" else "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"