Hi, In article <[email protected]>, MerceanCoconut<[email protected]> wrote: > would like to write a script that starts a rescan and then waits until > the scan is finished before continuing: > > echo "rescan" | nc server 9090 > > then poll the server with: > > echo "rescan ?" | nc server 9090 > > I expect to receive "rescan 0" or "rescan 1"; however, the 'rescan ?' > command returns no response. I do get a response if I send a command > like: > > echo "info total albums ?" | nc server 9090 > > returns: > > info total albums 645 > > Does anyone know how I can get the rescan status?
Netcat might be disconnecting before the response is sent. Try messing with the delay parameter (-i) to put (say) 2 seconds delay between each command. You might also need to add another command after the one you're interested in to prevent the disconnect: echo -e "rescan ?\ninfo total albums ?\n" | nc -i 2 server 9090 Andy _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/unix
