On Fri, 2011-12-09 at 18:58 +0100, Moritz Struebe wrote:
Sorry for that, too many patches flying around. :)
Morty
On 2011-12-09 18:57, Moritz Struebe wrote:
Hi there,
this did cost us some pains, because a sshd was using port 6050, so even reinstalling x2goserver didn't solve any issues. This is a pretty hackish solution and maybe someone with a little more bash experience could take a look. <snip> Only two silly thoughts. Are we sure that all distributions use a space and not a \t after the port number? If not, perhaps something like netstat -ntl | grep ":${X2GO_PORT}[^0-9][^0-9]*" would work (the port followed by at least one non-numeric character.
What about the bizarre corner case where someone may have specified a source port for the connection and that port happens to be ${X2GO_PORT}. Does that mean it will show up in the Foreign Address column? Would it be better to use awk to pull out the fourth column (I forget off hand how to do that) and then grep only the fourth column? Then we might even be able to use netstat -ntl | grep ":${X2GO_PORT}\$" (not 100% sure of that syntax either). Thanks - John