diff options
Diffstat (limited to 'abs/core/LinHES-config/mv_vnc.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_vnc.py | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/abs/core/LinHES-config/mv_vnc.py b/abs/core/LinHES-config/mv_vnc.py index bc7a201..0260494 100755 --- a/abs/core/LinHES-config/mv_vnc.py +++ b/abs/core/LinHES-config/mv_vnc.py @@ -79,12 +79,30 @@ exec wmaker logging.info("__End of vnc \n") +def start_xvnc(xvncpasswd): + logging.info(" Checking if x11vnc needs to be started") + if mv_common.check_service("frontend"): + logging.info(" Frontend is running, starting x11vnc") + line='''su mythtv -c "DISPLAY=localhost:0 x11vnc -rfbport 5902 --passwd %s 2>&1 > /dev/null &" \n''' %xvncpasswd + #line='''su mythtv -c "DISPLAY=localhost:0 xscreensaver -no-splash \&" ''' + try: + fout = open("/tmp/cmd.sh", "w") + fout.write(line) + fout.close() + os.chmod("/tmp/cmd.sh",0755) + cmd="/tmp/cmd.sh" + os.system(cmd) + os.remove("/tmp/cmd.sh") + except: + logging.info(" Couldn't start x11vnc") + + def setupvnc(systemconfig,data_config): logging.info("____Start of vnc config ____") if mv_common.read_config(mv_common.module_config,"vnc") == False : logging.info("____Skipping of vnc, config disabled____") return - + #vncservice try: vnc=systemconfig.get("vncenable") except: @@ -96,5 +114,20 @@ def setupvnc(systemconfig,data_config): mv_common.add_service("vnc") else: mv_common.remove_service("vnc") + #x11vnc + try: + xvnc=systemconfig.get("xvncenable") + xvncpasswd=systemconfig.get("xvncpassword") + except: + xvnc = "0" + xvncpassword="LinHES" + + if xvnc == "1": + logging.info(" Installing x11vnc system\n") + mv_common.pacinstall("x11vnc") + start_xvnc(xvncpasswd) + else: + mv_common.pacinstall("x11vnc") + logging.info("__End of vnc\n")
\ No newline at end of file |