]> git.plutz.net Git - serve0/commitdiff
set up remote player in local.opts
authorpaul <paul@plutz.net>
Sun, 10 Dec 2017 00:45:29 +0000 (00:45 +0000)
committerpaul <paul@plutz.net>
Sun, 10 Dec 2017 00:45:29 +0000 (00:45 +0000)
svn path=/trunk/; revision=194

actions/watch.sh
globals.sh
pages/playctl.sh

index 596ca32ad43c96bcd7d4c26410d2369f9b57ad34..1ba0954192943b07529c80d842b9670b3639cdf5 100755 (executable)
@@ -41,11 +41,9 @@ fi
 
 case "$_COOKIE[watch]" in
   raspi)
-    #rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch"
-    #redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/${_POST[page]}")"
-    ncat atoemchen 80 >&- <<-EOF
+    ncat "$RHOST" "$RPORT" >&- <<-EOF
        GET /?action=watch&url=$(urlsafe "http://${HTTP_HOST}/${videourl}") HTTP/1.1$(printf \\r)
-       Host: atoemchen$(printf \\r)
+       Host: ${RHOST}$(printf \\r)
        $(printf \\r)
        EOF
     redirect "?p=playctl&${watch_link}w=$(urlsafe "${_POST[page]}#${_GET[i]}")"
index b68a8c9e977a803cc0b22868da2d5b8b6054d67a..402cba23f3f33a56508c4b0bf398cca43471971e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-# Copyright 2014,2015 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
 #
 # This file is part of Serve0.
 # 
@@ -30,3 +30,6 @@ _GET[pn]=$(validate "${_GET[pn]}" '[1-9][0-9]*' 1)
 
 cgi_cookie
 _COOKIE[pagesize]=$(validate "${_COOKIE[pagesize]}" '[1-9][0-9]*' 50)
+
+[ -z "$RHOST" ] && RHOST=localhost
+[ -z "$RPORT" ] && RPORT=80
index 36363516a0e2d9422e252fd94ceda8355ef8ec45..f8247e02d33cbf1278b96ab7c35ee434929dac6b 100755 (executable)
@@ -44,10 +44,10 @@ head -n1 "$meta" |read length width height TITLE
 debug VIDEO: $video
 
 if [ "$_COOKIE[watch]" = raspi ]; then
-  actionuri='//atoemchen/?action=playctl'
-  volume="$({ncat atoemchen 80 <<-EOF
+  actionuri="//${RHOST}:${RPORT}/?action=playctl"
+  volume="$({ncat "$RHOST" "$RPORT" <<-EOF
        GET /?action=playctl&api=volume HTTP/1.0${CR}
-       Host: atoemchen${CR}
+       Host: ${RHOST}${CR}
        ${CR}
        EOF
   } | sed -r '1,/^\r$/d')"
@@ -71,9 +71,9 @@ printf 'Refresh: 1\r\n'
 
 progress(){
   if [ "$_COOKIE[watch]" = raspi ]; then
-    { ncat atoemchen 80 <<-EOF
+    { ncat "$RHOST" "$RPORT" <<-EOF
        GET /?action=playctl&api=progress HTTP/1.0${CR}
-       Host: atoemchen${CR}
+       Host: ${RHOST}${CR}
        ${CR}
        EOF
     } | sed -ur '1,/^\r$/d'