--- a/upcmd.sh
+++ b/upcmd.sh
@@ -20,13 +20,23 @@
}
usage()
{
- upmcmd service-action.xml [paramname value ...]
-}
+ fatal "Usage: upcmd.sh host:port service-action.xml [paramname value ...]\n
+ Examples:\n
+ upcmd.sh AVTransport-Play.xml\n
+ upcmd.sh OHVolume-SetVolume.xml Value 30\n
+ (look up the parameter names, this is not always 'Value')\n
+ "
+}
-test $# -ge 1 || usage
+test $# -ge 2 || usage
+
+hostport=$1
+shift
+
xml=$1
test -f "$xml" || fatal $xml does not exist
shift
+
sedcmd=''
while test $# -gt 0;do
name=$1
@@ -41,10 +51,10 @@
service=`echo $sa | awk -F- '{print $1}'`
action=`echo $sa | awk -F- '{print $2}'`
-# Upmpdcli AND renderer-specific: host name, port, control url computation
-uribase=http://hm1:49152/ctl
+# Upmpdcli-specific: control url computation.
+uribase=http://$hostport/ctl
ctluri=$uribase/$service
-
+# End specific
if test "X$sedcmd" != "X"; then
postdata=`sed $sedcmd < $xml`