From 1f63880a8ee94540afcdda232844b9d59a61d9a2 Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Wed, 1 Apr 2020 16:51:01 +0200 Subject: [PATCH 1/2] add command-line options --- reStream.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/reStream.sh b/reStream.sh index e20237e..4ef14af 100755 --- a/reStream.sh +++ b/reStream.sh @@ -3,10 +3,23 @@ # these are probably the only two parameters you need to change ssh_host="root@10.11.99.1" # location of the remarkable landscape=true # default vertical -if [ "$1" = "-p" ] # call with -p if you want vertical -then - landscape=false -fi + +# Loop through arguments and process them +for arg in "$@" +do + case $arg in + -p|--portrait) + landscape=false + shift + ;; + -h|--host) + ssh_host="$2" + shift + shift + ;; + *) + esac +done # technical parameters width=1408 @@ -74,4 +87,3 @@ ssh "$ssh_host" "$read_loop" \ -video_size "$width,$height" \ $landscape_param \ -i - - From 8465062425a3d153291edbe7f7e55394cda5657b Mon Sep 17 00:00:00 2001 From: Aaron David Schneider Date: Thu, 2 Apr 2020 10:23:58 +0200 Subject: [PATCH 2/2] change name to -d --- reStream.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reStream.sh b/reStream.sh index 4ef14af..f1bcede 100755 --- a/reStream.sh +++ b/reStream.sh @@ -12,7 +12,7 @@ do landscape=false shift ;; - -h|--host) + -d|--destination) ssh_host="$2" shift shift