2

I am connecting to a Denon DN-700H network Audio player over IP and have managed to change stations using the following commands in OS X Terminal:

telnet
telnet 10.22.71.11

which connects successfully, then I see this output:

Trying 10.22.71.11...
Connected to 10.22.71.11.
Escape character is '^]'.
BridgeCo AG Telnet server

I then input the following to change to a specific Favourite station:

FV 01

which works, changing the Favourite on the DN-700H. The output shows:

NSE2Now Playing
NSE2106 Jack FM Hertfordshire
NSE2106 Jack FM Hertfordshire
NSE8  000:01     100%         

My question is... how can I script this process? I have succesfully made the connection using the script below, but am failing to actually issue commands to the unit after that. Here is the script I have created so far:

#!/bin/sh

telnet 10.22.71.11
sleep 2
send "FV 02"

Any tips on recreating what I have achieved by interacting in Terminal as a script would be greatly appreciated. Thanks

1 Answers1

2

Duplicate of:

automating telnet session using bash scripts

Creating a script for a Telnet session?

My suggestion: if you just want to run commands without reading the resulting values, then pass an input file to telnet:

$ { echo FV 02; sleep 5; } | telnet 10.22.71.11
Community
  • 1
  • 1
hdante
  • 7,685
  • 3
  • 31
  • 36