piano(1)

NAME
piano - Command interface to pianod(1).

SYNOPSIS
piano [-cdvm] [-r] [-s] [-h host] [-p port] [-U username] [-P password] [command [Arguments ...]]

DESCRIPTION
piano issues commands to and retreives data from pianod(1), allowing shell scripts or interactive access without having to go through telnet(1) or nc(1). Options allow formatting data in various ways, either convenient for reading (interactive use) or in more raw forms (for further processing).

If no command is given, retrieves the playback status (playing, paused, stopped, etc.) instead of issuing a command; status is indicated only by exit status unless -v is given.

OPTIONS

-c  In output, include numeric status codes.

-d  Data only; in output, strip the field names.

-v  Verbose. Output status text instead of just returning a status code. Applies to checking status or station.

-m  Multiple record format. Includes pianod's end-of-data message at the end of the output, which is extraneous for single records but useful when processing multiple records.

-r  Report remaining time in current track. Returned as a number of seconds, suitable for passing to sleep(1).

-s  Check if a station is selected. Result is indicated only by exit status; use with -v to get station type and name.

-h host
    The host on which pianod is running. Defaults to localhost, or $PIANOD_HOST if set.

-p port
    The port at which to connect to pianod. By default, connections are attempted at 4445. piano can connect to either the line or HTTP port.

-U user
    The user to authenticate on the server. Not all commands require authentication; if neither this option or the corresponding environment variable are indicated, then authentication is not performed.

-P password
    The password to authenticate with.

ENVIRONMENT

PIANOD_HOST
    The pianod host to connect to.

PIANOD_PORT
    The port at which to connect to pianod.

PIANOD_USER
    The username to authenticate with.

PIANOD_PASSWORD
    The password with which to authenticate.

FILES
None.

RETURN VALUES

0   if the command succeeds, or the server is playing (including being between tracks or stalled), or there is a selected station

1   in the event of a server error response, or the server is not playing, or there is no selected station

255 if the server cannot be reached, does not respond, or otherwise does something unexpected

AUTHOR
Perette Barella <perette@deviousfish.com>.

COPYRIGHT
Copyright Perette Barella. piano is available under the MIT license.

SEE ALSO
pianod(1), runmix(1), football(3)