From e4d0a6c3ad95cf898c2fc5343bb7ff6ff6c0dddd Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 20 Sep 2018 23:35:03 -0700 Subject: [PATCH] Fixed Master branch (#41) * Removed Nasty .DS_Store and #!/bin/sh to #!/bin/bash * Fixed everything on the master branch --- .gitignore | 4 ++++ README.md | 2 +- getFileFromDir.sh | 4 ++-- radioFiles/.DS_Store | Bin 8196 -> 0 bytes radioFiles/gifs/.DS_Store | Bin 6148 -> 0 bytes radioFiles/music/.DS_Store | Bin 6148 -> 0 bytes runFfmpeg.sh | 4 ++-- startStream.sh | 5 +++-- 8 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 radioFiles/.DS_Store delete mode 100644 radioFiles/gifs/.DS_Store delete mode 100644 radioFiles/music/.DS_Store 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 3b9ee1f247188acb581b2092dcf9b1e46db93f4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM%Wl&^6ur|X;D8VXA*D-ikXTevBC3{$kU~foT_7QXU;&8QacC^ro+x$*5Q4Jd z6F}t?*t1~47KtA~d=8v>U>qmuE)>d)H1|w=A2U94{kRShvBtow5v>!Eg)VUIG{l@H z^rFwS6@BD9kinnGr+unWhn|x&V{Hx?1`Gp+0mFb{z%cMPFo0*aXx4(~zS0_L7%&X{ zmkfyegN-h*u5qGJ-Z~&;2>>kMuxuEk4v;>!#=6FdLg|W_s(N7BmFW_LDR<~?VGgWo zoG4W8#FRTRJu}l43X`+L&z9!I>I#iC3>XGx84$JmIcgK9h@MW>?;-UlKrLUPn7X?G zZ@U3^VT}uny#ZeOA)5?Ygs+H@P&{o(pP>IZ-_jk%JstCl+Y9_SsaC(UmDNJ=#7V1E zvPx&H$E_|Owh|{9#0{taQ2z40j;qJ_I1kdX!zXJOZt*B_{HW87N=)B@ z=&bsk%6AxLhzRy;tu_yPseVcu@@CT;ByFN^*FImDHW}ZLdxvOy-NPb3YxSdmNBf8= zR$9O(86Vq|-xx7xb_-Lxqp71!_drcBqeBACQO9JfaRV89dh~L)zD)&gJq* z=3L5J%Ad_=f;g6w7+|H_v~$ KrAGV%4EzKKCZp;A diff --git a/radioFiles/gifs/.DS_Store b/radioFiles/gifs/.DS_Store deleted file mode 100644 index ab94b64beed68077957ef3d6f7ffcc8998ee3478..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJxc>Y5PhR50wSbLxuum5TML(v6xRNM7{3Ud#73~ZLhxtnn~%sHceWNf12b=T zcHZsXD{giH$ny1m0n7kQ>5BN!Ff?6PAJ|c36vdwLf(8#LSm1n6J)ThRDLHSr#WTA6 zC+zTe-R$qS&3?-&eZ@=q`==R4W6TTgJjT3Y^;w5$^bDy$Dv%1K0;#}1RDeBOZF=IE zF%?J!Qh{#;^#4%kiZ!rxv|k5<9^Z9+qNv8P-6e=6<~6W&?LXHylVB^gJr%(+ zvrJx?%uHrq!e#@&)tCJ$PzF$<3Kovp{30?gx*>&VIU+jE(Zc{Uq?qtA`40@p+MS_> zcZ@N|`ucfXz~i3lxzw>Srl`;&)+x@lV z;bL2T?nyXUtM7J4eb3A~XD->}Bl041wpi7W{V8>!m4@nWIMyLQDXn6kQRR&q+DlpU zd<$cbtf;wGky64#5^D^6#EfS8mut}{*-|)qOV`v 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")