LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bash script to find available display sever (https://www.linuxquestions.org/questions/linux-software-2/bash-script-to-find-available-display-sever-832686/)

ralfbutler 09-16-2010 07:51 PM

Bash script to find available display sever
 
Hi there,

Whenever I login to a server via ssh -X, I want that all 5 minutes a script displays a graph.
The script shows the image via display (imagemagick). But what I'm not sure of is how to redirect the display output to my remote screen when this script is executed as a cron job. I can use display -display server but I don't know how to determine server via the script.

Thanks,
Ralf

xeleema 09-18-2010 05:15 AM

Greetingz!

If the server you're SSHing from is running the display, then you could have the script use the "who" command.

Sample Output of "who"
Code:

sysop@server(SunOS)$ who
sysop  pts/2    Sep 17 12:39 (desktop.example.com)
sysop  dtremote  Sep 17 22:07 (desktop.example.com:0)
sysop  dtremote  Sep 17 05:49 (desktop.example.com:0)



All times are GMT -5. The time now is 03:14 AM.