I had a problem when using this fix I recommended, when I had vnc installed.
Code:
[ ! -z $SSH_TTY ] || exit #Exit if SSH'ing in
So I had a look around the net and this seems more robust:
Code:
if [ ${SSH_TTY:-No} != No ] ; then
echo "Can't run X windows as you are logged in by SSH...."
exit
fi
It uses a little known construct, reference can be found here
www.ooblick.com/text/sh/
I had a VNC session open to the Grafpup machine as well as some SSH terminals, but was working on the console. I found that the xwin command was silently exiting due to my old fix.
I thought I'd better make sure the 'exit' didn't occur if the variable was *not* defined, which it could do with the old line.
You can prove it to yourself by saying to sh:
Code:
% echo $THIS_VAR_DOESNT_EXIST
%
The shell returns a blank line for a non-existent shell variable, and this I think was messing up my old test. The new one doesn't fall foul of that.
Happy 4th of July!