Skip to content

Commit 8266140

Browse files
Merge pull request #6 from RandomCoderOrg/5-show-ipv-address-after-starting-vnc
5 show ipv address after starting vnc
2 parents 1d4a575 + ca94f1e commit 8266140

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

utils/info.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@
22
from utils.funs import *
33

44
######## VNC
5-
HOSTPUBIP=os.system("hostname -I | cut -d ' ' -f 2")
5+
if os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read() is '':
6+
# hostname returs \n which can effect logic
7+
IPv4Address = os.popen("hostname -I | tr -d '\\n'").read().strip()
8+
else:
9+
IPv4Address = os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read().strip()
10+
611
LOCALIP="127.0.0.1"
712

813
def vncokdialog(port):
914
return "vncserver started on "\
1015
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
11-
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
16+
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
1217
+"\n"+"To stop it, run:\n"\
1318
+green("vncserver -kill :"+str(port))\
1419
+" or "+blue("stopvnc")
1520

1621
def vncrunningdialog(port):
1722
return "vncserver already started on "\
1823
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
19-
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
24+
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
2025
+"\n"+"To stop it, run:\n"\
2126
+green("vncserver -kill :"+str(port))\
2227
+" or "+blue("stopvnc")
23-

utils/upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from utils.funs import *
33

4-
CURRENT_VERSION = "v0.3"
4+
CURRENT_VERSION = "v0.4"
55
REMOTE_VERISON = os.popen("git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/RandomCoderOrg/udroid-extra-tool-proot | tail -n1 | cut -d \"/\" -f 3").read().strip()
66

77
def isold():

0 commit comments

Comments
 (0)