wmfortune: Add version 0.241 to repository.
[dockapps.git] / wmradio / wmradio-remote
blobe1ba2779830a2dfba513058573a29790f8c7a269
1 #!/bin/sh
3 PIPEPREFIX=/tmp/wmradio_
5 PIPE=${PIPEPREFIX}`id -u`
7 if [ "$1" = "" ] ; then
8 echo -e "Usage: $0 COMMAND [param]\n"\
9 "valid commands are:\n"\
10 " POWER\n"\
11 " TUNE_MINUS\n"\
12 " FINE_TUNE_MINUS\n"\
13 " TUNE_PLUS\n"\
14 " TUNE_NAME_NEXT\n"\
15 " TUNE_NAME_PREV\n"\
16 " FINE_TUNE_PLUS\n"\
17 " SET_PRESET\n"\
18 " SAVE_PRESET\n"\
19 " SCAN\n"\
20 " READ_CONFIG"
21 exit 1
23 if [ ! -p $PIPE ] ; then
24 echo "Pipe $PIPE doesn't exist! Is wmradio started?"
25 exit 1
29 case "$1" in
30 POWER|TUNE_MINUS|FINE_TUNE_MINUS|TUNE_PLUS|\
31 FINE_TUNE_PLUS|SCAN|TUNE_NAME_NEXT|TUNE_NAME_PREV|\
32 READ_CONFIG)
33 echo $1 >>$PIPE
35 SET_PRESET|SAVE_PRESET)
36 if [ "$2" = "" ] ; then
37 echo "wmradio-remote: command \"$1\" need an argument"
38 exit 1
40 echo $1 `expr $2 - 1` >>$PIPE
43 echo "wmradio-remote: invalid command \"$1\""
45 esac