Skip to content

Commit bc995a3

Browse files
Merge pull request #4 from RandomCoderOrg/fix01-patch
Fix01 patch
2 parents b78f86e + 37299d7 commit bc995a3

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

etc/scripts/hippo/hippo.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
version=1
44

5+
if [ -n "$HIPPO_BRANCH" ]; then
6+
BRANCH="$HIPPO_BRANCH"
7+
fi
58

69
CACHE_ROOT="${HOME}/.uoa-cache-root"
710
TPREFIX="/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+
2030
function __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

install.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ BIN_DIR="${TPREFIX}/usr/bin"
66
echo "setting hippo..."
77

88
if [ -f etc/scripts/hippo/hippo.sh ]; then
9-
DIR="etc/scripts/hippo/hippo.sh"
10-
cp ${DIR} ${BIN_DIR}/hippo
9+
FILE="etc/scripts/hippo/hippo.sh"
10+
if [ -f ${BIN_DIR}/hippo.sh ]; then
11+
rm -rf "${BIN_DIR}/hippo.sh"
12+
fi
13+
cp ${FILE} ${BIN_DIR}/hippo
1114
chmod 775 ${BIN_DIR}/hippo
1215
else
1316
echo "Installation Failed..."

0 commit comments

Comments
 (0)