File tree Expand file tree Collapse file tree 4 files changed +64
-199
lines changed
Expand file tree Collapse file tree 4 files changed +64
-199
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ version=0
55TPREFIX=" /data/data/com.termux/files"
66
77SCRIPT_DIR=" ${TPREFIX} /usr/etc/proot-distro/"
8- INSTALL_FOLDER=" ${TPREFIX} /usr/varlib /proot-distro/installed-rootfs"
8+ INSTALL_FOLDER=" ${TPREFIX} /usr/var/lib /proot-distro/installed-rootfs"
99
1010HIPPO_DIR=" ${INSTALL_FOLDER} /hippo"
1111HIPPO_SCRIPT_FILE=" ${SCRIPT_DIR} /hippo.sh"
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- vncserver --kill :1
3+ DEFAULT_XSTARTUP=" ${HOME} /.vnc/xstartup"
4+ # DEFAULT_XSTARTUP_HIDPI=""
45
6+ num=' ^[0-9]+$'
7+ if [ -n " $DEFAULT_VNC_PORT " ]; then
8+ if [[ ${DEFAULT_VNC_PORT} =~ $num ]]; then
9+ port=" ${DEFAULT_VNC_PORT} "
10+ echo " VNC port set to ${port} "
11+ else
12+ echo " variable DEFAULT_VNC_PORT dosent contain a valid port number..."
13+ echo " getting back to default = 1..."
14+ port=" 1"
15+ fi
16+ else
17+ port=" 1"
18+ fi
19+
20+ if [ -f /tmp/.X11-unix/X${port} ]; then
21+ vnc=true
22+ elif [ -f /tmp/.X${port} -lock ]; then
23+ vnc=true
24+ else
25+ vnc=false
26+ fi
27+
28+
29+ if ! $vnc ; then
30+ vncserver -xstartup " ${DEFAULT_XSTARTUP} " -desktop " Hippo Default VNC" :${port}
31+ else
32+ echo " A vncserver lock is found for port ${port} "
33+ echo " Use \e[1;32mhippo stoptvnc\e[0m or \e[1;32mstopvnc\e[0m to stop it and try again..."
34+ fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # #############
4- # Kill vnc script
3+ num=' ^[0-9]+$'
4+ if [ -n " $DEFAULT_VNC_PORT " ]; then
5+ if [[ ${DEFAULT_VNC_PORT} =~ $num ]]; then
6+ port=" ${DEFAULT_VNC_PORT} "
7+ echo " VNC port set to ${port} "
8+ else
9+ echo " variable DEFAULT_VNC_PORT dosent contain a valid port number..."
10+ echo " getting back to default = 1..."
11+ port=" 1"
12+ fi
13+ else
14+ port=" 1"
15+ fi
516
17+
18+ echo " Stoping VNCSERVER at port :1"
19+ vncserver --kill :${port} >> /dev/null
20+
21+ if [ -f /tmp/.X11-unix/X${port} ]; then
22+ echo " cleaning lock files..."
23+ elif [ -f /tmp/.X${port} -lock ]; then
24+ echo " cleaning lock files..."
25+ fi
26+
27+ echo " Cleaning pid,log files at ~/.vnc ..."
28+ for files in ~ /.vnc/* $(( 5900 + port)) {.log,.pid}; do
29+ if [ -f " ${files} " ]; then
30+ echo " cleaning ${files} ..."
31+ rm -rf " ${files} "
32+ fi
33+ done
34+
35+ echo " done"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments