diff --git a/.gitignore b/.gitignore index ee9e685..1169d6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# OSX Files +**/.DS_Store + +# Other build files ffmpeg-source/* libfdk* libfdk*/* diff --git a/README.md b/README.md index 5dfbe14..71a93b9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Next, install the dependencies. This will take a little bit of time, probably 5- ./installDeps.sh ```` -Then you probably want to edit your `config.sh` file to provide your Stream key and url (Default URL is for youtube). +Then you probably want to edit your `config.sh` file to provide your Stream key and url (Default URL is for youtube). Copy the example, and then edit the final `config.sh`. ```` cp radioFiles/config.example.sh radioFiles/config.sh diff --git a/getFileFromDir.sh b/getFileFromDir.sh index c881204..c77869b 100755 --- a/getFileFromDir.sh +++ b/getFileFromDir.sh @@ -7,6 +7,6 @@ if [ "$#" -ne 1 ]; then echo "USAGE: ./getFileFromDir.sh [Directory path]" else # Use find instead of ls to better handle non-alphanumeric filenames. - ranfile=$( find "$1" | sort --random-sort | tail -1 ) - echo "$1/$ranfile" + ranfile=$( find "$1" -mindepth 1 | sort --random-sort | tail -1 ) + echo "$ranfile" fi diff --git a/radioFiles/.DS_Store b/radioFiles/.DS_Store deleted file mode 100644 index 3b9ee1f..0000000 Binary files a/radioFiles/.DS_Store and /dev/null differ diff --git a/radioFiles/gifs/.DS_Store b/radioFiles/gifs/.DS_Store deleted file mode 100644 index ab94b64..0000000 Binary files a/radioFiles/gifs/.DS_Store and /dev/null differ diff --git a/radioFiles/music/.DS_Store b/radioFiles/music/.DS_Store deleted file mode 100644 index 2385d44..0000000 Binary files a/radioFiles/music/.DS_Store and /dev/null differ diff --git a/runFfmpeg.sh b/runFfmpeg.sh index de34ac3..6e5aa5d 100755 --- a/runFfmpeg.sh +++ b/runFfmpeg.sh @@ -16,12 +16,12 @@ else STREAM_TEXT_PATH=$2 # Souce our config - .radioFiles/config.sh + source radioFiles/config.sh # Define our private variables # KEYINT represents the number of key frames. # Should be somewhere between 2 to 4. - KEYINT=${#VIDEO_FPS \* 3} + KEYINT=$(expr $VIDEO_FPS \* 3) # Run our ffmpeg command # Draw text on multiple lines diff --git a/startStream.sh b/startStream.sh index 758d361..659574d 100755 --- a/startStream.sh +++ b/startStream.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Source our config files source radioFiles/config.sh @@ -36,6 +36,7 @@ echo "$CURRENT_GIF" > "$CURRENT_GIF_PATH" RANDOM_GIF=$(./getFileFromDir.sh "$GIF_DIRECTORY") ./optimizeGif.sh "$RANDOM_GIF" "$CURRENT_GIF" + echo " " echo " " echo "--------------------------------------------------" @@ -53,7 +54,7 @@ while true ; do RANDOM_SONG="" # Check if we support interludes, and we should show one - if [ "$RADIO_INTERLUDES" = true ] && [ "${#(date +%s) % $RADIO_INTERLUDE_INTERVAL_LENGTH }" = 0 ]; then + if [ "$RADIO_INTERLUDES" = true ] && [ $(expr $(date +%s) % $RADIO_INTERLUDE_INTERVAL_LENGTH) = 0 ]; then # Get our random song RANDOM_SONG=$(./getFileFromDir.sh "$INTERLUDE_DIRECTORY")