22
33version=1
44
5+ if [ -n " $HIPPO_BRANCH " ]; then
6+ BRANCH=" $HIPPO_BRANCH "
7+ fi
58
69CACHE_ROOT=" ${HOME} /.uoa-cache-root"
710TPREFIX=" /data/data/com.termux/files"
@@ -17,6 +20,13 @@ SOCIAL_PLATFORM="\e[1;34mhttps://discord.gg/TAqaG5sEfW\e[0m"
1720# HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}"
1821# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh"
1922
23+
24+ die () { echo -e " ${RED} Error ${* }${RST} " ; exit 1 ; : ; }
25+ warn () { echo -e " ${RED} Error ${* }${RST} " ; : ; }
26+ shout () { echo -e " ${DS} ////////" ; echo -e " ${* } " ; echo -e " ////////${RST} " ; : ; }
27+ lshout () { echo -e " ${DC} " ; echo -e " ${* } " ; echo -e " ${RST} " ; : ; }
28+
29+
2030function __check_for_hippo() {
2131 if [ -d ${HIPPO_DIR} ] && [ -f ${HIPPO_SCRIPT_FILE} ]; then
2232 return 0;
@@ -96,10 +106,17 @@ function __force_uprade_hippo()
96106{
97107 if [ ! -d " $CACHE_ROOT " ]; then
98108 mkdir " $CACHE_ROOT "
109+ else
110+ rm -rf " ${CACHE_ROOT} /fs-manager-hippo"
99111 fi
100112
101113 FSM_URL=" https://github.com/RandomCoderOrg/fs-manager-hippo"
102- git clone ${FSM_URL} " ${CACHE_ROOT} /fs-manager-hippo" || die " failed to clone repo"
114+
115+ if [ -z " ${BRANCH} " ]; then
116+ git clone ${FSM_URL} " ${CACHE_ROOT} /fs-manager-hippo" || die " failed to clone repo"
117+ else
118+ git clone -b " ${BRANCH} " " ${CACHE_ROOT} /fs-manager-hippo" || die " failed to clone repo"
119+ fi
103120
104121 if [ -f " ${CACHE_ROOT} " /fs-manager-hippo/install.sh ]; then
105122 cd " ${CACHE_ROOT} " /fs-manager-hippo || die " failed to cd ..."
@@ -152,18 +169,17 @@ function _lauch_or_install()
152169
153170
154171 pulseaudio --start --load=" module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 >> /dev/null
155- if [ -f " {CACHE_ROOT}" /ubuntu-on-android/etc/scripts/vncserver/startvnc.sh ] && [ ! -f ${HIPPO_DIR} /bin/startvnc ]; then
156- DIR=" {CACHE_ROOT}/ubuntu-on-android/etc/scripts/vncserver/startvnc.sh"
157- cp ${DIR} ${HIPPO_DIR} /bin/startvnc
172+ if [[ -f " $ {CACHE_ROOT}" /ubuntu-on-android/etc/scripts/vncserver/startvnc.sh ]] && [[ ! -f ${HIPPO_DIR} /bin/startvnc ] ]; then
173+ DIR=" $ {CACHE_ROOT} /ubuntu-on-android/etc/scripts/vncserver/startvnc.sh"
174+ cp " ${DIR} " ${HIPPO_DIR} /bin/startvnc
158175 proot-distro login hippo -- chmod 775 /bin/startvnc
159176 fi
160- if [ -f " {CACHE_ROOT}" /ubuntu-on-android/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR} /bin/stopvnc ]; then
177+ if [ -f " $ {CACHE_ROOT}" /ubuntu-on-android/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR} /bin/stopvnc ]; then
161178 DIR=" ${CACHE_ROOT} /ubuntu-on-android/etc/scripts/vncserver/stopvnc.sh"
162179 cp " ${DIR} " ${HIPPO_DIR} /bin/stopvnc
163180 proot-distro login hippo -- chmod 775 /bin/stopvnc
164181 fi
165-
166- proot-distro login hippo " $@ "
182+ proot-distro login hippo " $@ " || warn " program exited unexpectedly..."
167183 fi
168184}
169185
0 commit comments