Skip to content

Commit

Permalink
Merge pull request #6 from RandomCoderOrg/5-show-ipv-address-after-st…
Browse files Browse the repository at this point in the history
…arting-vnc

5 show ipv address after starting vnc
  • Loading branch information
SaicharanKandukuri authored Apr 12, 2022
2 parents 1d4a575 + ca94f1e commit 8266140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions utils/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@
from utils.funs import *

######## VNC
HOSTPUBIP=os.system("hostname -I | cut -d ' ' -f 2")
if os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read() is '':
# hostname returs \n which can effect logic
IPv4Address = os.popen("hostname -I | tr -d '\\n'").read().strip()
else:
IPv4Address = os.popen("hostname -I | cut -d \" \" -f 2 | tr -d '\\n'").read().strip()

LOCALIP="127.0.0.1"

def vncokdialog(port):
return "vncserver started on "\
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
+"\n"+"To stop it, run:\n"\
+green("vncserver -kill :"+str(port))\
+" or "+blue("stopvnc")

def vncrunningdialog(port):
return "vncserver already started on "\
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
+"\n"+magneta(str(LOCALIP)+":"+str(port))\
+"\n"+magneta(str(IPv4Address)+":"+str(port))\
+"\n"+"To stop it, run:\n"\
+green("vncserver -kill :"+str(port))\
+" or "+blue("stopvnc")

2 changes: 1 addition & 1 deletion utils/upgrade.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from utils.funs import *

CURRENT_VERSION = "v0.3"
CURRENT_VERSION = "v0.4"
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()

def isold():
Expand Down

0 comments on commit 8266140

Please sign in to comment.