Skip to content

Commit b7b2a58

Browse files
#5 show ipv4 address
show ipv4 address of device after starting vnc
1 parent 1d4a575 commit b7b2a58

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utils/info.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
import os
1+
from ipaddress import IPv4Address
2+
import os, socket
23
from utils.funs import *
34

45
######## VNC
5-
HOSTPUBIP=os.system("hostname -I | cut -d ' ' -f 2")
6+
IPv4Address=socket.gethostbyname(socket.gethostname())
67
LOCALIP="127.0.0.1"
78

89
def vncokdialog(port):
910
return "vncserver started on "\
1011
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
11-
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
12+
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
1213
+"\n"+"To stop it, run:\n"\
1314
+green("vncserver -kill :"+str(port))\
1415
+" or "+blue("stopvnc")
1516

1617
def vncrunningdialog(port):
1718
return "vncserver already started on "\
1819
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
19-
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
20+
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
2021
+"\n"+"To stop it, run:\n"\
2122
+green("vncserver -kill :"+str(port))\
2223
+" or "+blue("stopvnc")

0 commit comments

Comments
 (0)