Tested the channelup script, seems to work well.

This commit is contained in:
Justin Emter
2017-08-20 14:19:19 -07:00
parent 8920277d6a
commit 298a6ab4a5
3 changed files with 39 additions and 35 deletions

View File

@@ -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