#!/bin/bash
case $2 in
left|right|up|down|select|back|stop|osd|close|number[0-9]|playpause|contextmenu|enter)
if [ "$1" == "Input.ExecuteAction" ];then
curl --data-binary "{ 'jsonrpc': '2.0', 'method': 'Input.ExecuteAction', 'params': { 'action': '$2' }, 'id': 1 }" -H 'content-type: application/json;' http://xbmc:xbmc@192.168.178.23:8080/jsonrpc
fi
if [ "$1" == "Input.home" ];then
curl --data-binary "{ 'jsonrpc': '2.0', 'method': 'Input.home', 'id': 1 }' -H 'content-type: application/json;" http://xbmc:xbmc@192.168.178.23:8080/jsonrpc ;
fi
;;
*)
exit
;;
esac