fix config check

master
Pascal Abresch 3 years ago
parent 4f89192e01
commit 811f9c324e
  1. 32
      remote

@ -1,16 +1,9 @@
#!/bin/sh
if test ! -f server; then
echo "server config missing"
exit 20
fi
if test ! -f user; then
echo "user config missing"
echo 30
fi
echo " Q: UI back W: UI move up E: UI select "
echo " A: UI move left S: Ui move Down D: UI move right"
echo "Y/Z: track back X: track next "
echo " U: big jumpback I: info O: big jump forward"
echo " J: jump back K: pause/play L: jump forward "
echo "+/N: volume up -/B: volume down M: mute/unmute "
@ -18,13 +11,25 @@ pw_path=$(dirname $(readlink -f $0))
server=$(cat $pw_path/server)
user=$(cat $pw_path/user)
if test ! -f $pw_path/server; then
echo "server config missing"
exit 20
fi
if test ! -f $pw_path/user; then
echo "user config missing"
echo 30
fi
call() {
curl -s --data-binary @$pw_path/json/$1 -H 'content-type: application/json;' ${server}/jsonrpc --anyauth --user $user --connect-timeout 1 > /dev/null &
curl -s --data-binary @$pw_path/json/$1 -H 'content-type: application/json;' $server/jsonrpc --anyauth --user $user --connect-timeout 1 > /dev/null &
}
while true;
do
eval read -n 1 -s character
case $character in
c)
call menu
;;
b)
call volumedown
;;
@ -40,9 +45,6 @@ do
i)
call info
;;
u)
call contextmenu
;;
j)
call smallbackward
;;
@ -83,6 +85,12 @@ do
m)
call mute
;;
u)
call bigbackward
;;
o)
call bigforward
;;
*)
echo -n $character
;;

Loading…
Cancel
Save