1

I'm trying to control vlc video playback on a remote machine using a script and remote ssh. I have machine A, which logs into machine B with this command:

# sshpass -p <password> ssh user@<machine-B-ip> screen -d -m ./playvideo.sh

machine B contains playvideo.sh and starts the vlc playback, it works but I then need to stop it after a certain number of seconds by command from machine A but can't work out how to do this. I know I need to reconnect and log back into the screen previously created, issue a 'stop' command and then exit but 'screen -r' doesn't work, screen -r gives an error:

# sshpass -p <password> ssh user@<machine-B-ip> screen -r echo stop
'Must be connected to a terminal.'

how do I get back into the screen on machine B and issue the word 'stop' in the terminal?

  • Please post your Script Instead of forcing screen to stop, would it not be easier to pass arguments to playvideo.sh such as --play, --stop, --pause, --rewind, and --fast-forward with maybe an --exit? – eyoung100 Dec 4 '14 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.