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?