From 298a6ab4a5aeae80c94b4ba4effc27600ca9a410 Mon Sep 17 00:00:00 2001 From: Justin Emter Date: Sun, 20 Aug 2017 14:19:19 -0700 Subject: [PATCH] Tested the channelup script, seems to work well. --- .gitignore | 1 + bash-scripts/channelup.sh | 17 ++++++++++-- pseudo_schedule.xml | 56 ++++++++++++++++----------------------- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 33d01ce..219a946 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ env/ *.pid *.json .cache/ +.prevplaying diff --git a/bash-scripts/channelup.sh b/bash-scripts/channelup.sh index 4162ffc..e728b70 100644 --- a/bash-scripts/channelup.sh +++ b/bash-scripts/channelup.sh @@ -35,11 +35,15 @@ CHANNEL_DIR_INCREMENT_SYMBOL="_" #----END EDITABLE VARS------- +FIRST_RUN=false + # If the previous channel txt file doesn't exist already create it (first run?) if [ ! -e "$OUTPUT_PREV_CHANNEL_PATH/$OUTPUT_PREV_CHANNEL_FILE" ]; then echo 1 > "$OUTPUT_PREV_CHANNEL_PATH/$OUTPUT_PREV_CHANNEL_FILE" + FIRST_RUN=true + fi # If the file exists b @@ -97,9 +101,18 @@ if [ "${#CHANNEL_DIR_ARR[@]}" -gt 1 ]; then # Finally let's trigger the startstop script in both the previous channel and the next channel dirs. # This will stop the previous channels playback & trigger the next channels playback - "$OUTPUT_PREV_CHANNEL_PATH"/"$PREV_CHANNEL_DIR"/"$SCRIPT_TO_EXECUTE" + + if [ "$FIRST_RUN" = false ]; then + cd "$OUTPUT_PREV_CHANNEL_PATH"/"$PREV_CHANNEL_DIR" && ./"$SCRIPT_TO_EXECUTE" + cd ../"$NEXT_CHANNEL" && ./"$SCRIPT_TO_EXECUTE" + else + + cd "$OUTPUT_PREV_CHANNEL_PATH"/"$NEXT_CHANNEL" && ./"$SCRIPT_TO_EXECUTE" + + fi + sleep 1 - "$OUTPUT_PREV_CHANNEL_PATH"/"$NEXT_CHANNEL"/"$SCRIPT_TO_EXECUTE" + fi diff --git a/pseudo_schedule.xml b/pseudo_schedule.xml index fbe4709..258e293 100644 --- a/pseudo_schedule.xml +++ b/pseudo_schedule.xml @@ -110,30 +110,25 @@ Cheers! - - + - - + - - + - - - + - + - + - - + - + - - + - - + - + - + - - + - + - + - - - + - + - + + +