The Following User Says Thank You to cddiede For This Useful Post: | ||
![]() |
2010-07-27
, 22:13
|
Posts: 45 |
Thanked: 3 times |
Joined on Jun 2010
|
#2
|
![]() |
2010-07-27
, 22:25
|
Posts: 42 |
Thanked: 13 times |
Joined on Jun 2010
@ Netherlands
|
#3
|
![]() |
2010-07-27
, 23:09
|
Posts: 45 |
Thanked: 3 times |
Joined on Jun 2010
|
#4
|
#!/bin/sh APPCHK=$(ps aux | grep -c x11vnc) if [ $APPCHK = '0' ]; then /usr/bin/nohup /usr/bin/x11vnc -forever & else /usr/bin/pkill x11vnc;/usr/bin/nohup /usr/bin/x11vnc -forever & fi
![]() |
2010-08-01
, 14:40
|
Posts: 12 |
Thanked: 1 time |
Joined on Jul 2010
|
#5
|
![]() |
2010-08-27
, 13:44
|
Posts: 292 |
Thanked: 131 times |
Joined on Dec 2009
|
#7
|
So I think I've got a solution:
I've placed the following script (called vncs) in:
/etc/network/if-up.d
What this does is first off, starts a vnc server on the N900 whenever a network connection is established.
Secondly, it will kill any vnc server that is already running so you don't end up with a boatload of vnc server processes running if you connect to several networks throughout the day.
script follows:
APPCHK=$(ps aux | grep -c x11vnc)
if [ $APPCHK = '0' ];
then
/usr/bin/nohup /usr/bin/x11vnc -forever &
else
/usr/bin/pkill x11vnc;/usr/bin/nohup /usr/bin/x11vnc -forever &
fi
I guess to have a truly persistent server you should change the "else" statement to do nothing. This should leave any running VNC server up and not start a new one when you start a new network connection.
I prefer the above so that the VNC that's running is kicked off by the latest network connection, be that gprs or Wi-Fi, and not by a network connection that was established previously, but each to his own.