We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 373ecf3 commit 7158addCopy full SHA for 7158add
utils/info.py
@@ -2,10 +2,11 @@
2
from funs import *
3
4
######## VNC
5
-if os.system("hostname -I | cut -d \" \" -f 2") is None:
6
- IPv4Address = os.system("hostname -I")
+if os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read() is '':
+ # hostname returs \n which can effect logic
7
+ IPv4Address = os.popen("hostname -I | tr -d '\\n'").read().strip()
8
else:
- IPv4Address = os.system("hostname -I | cut -d \" \" -f 2")
9
+ IPv4Address = os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read().strip()
10
11
LOCALIP="127.0.0.1"
12
@@ -24,3 +25,5 @@ def vncrunningdialog(port):
24
25
+"\n"+"To stop it, run:\n"\
26
+green("vncserver -kill :"+str(port))\
27
+" or "+blue("stopvnc")
28
+
29
+print(vncokdialog(5900))
0 commit comments