Skip to content

Commit ed7e95b

Browse files
fixed issue with upgrader
1 parent d7670d7 commit ed7e95b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

etc/scripts/hippo/hippo.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22

3-
version=0
3+
version=1
44

55
CACHE_ROOT="${HOME}/.uoa-cache-root"
66
TPREFIX="/data/data/com.termux/files"
77

8-
SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro/"
8+
SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro"
99
INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs"
1010

1111
HIPPO_DIR="${INSTALL_FOLDER}/hippo"
@@ -46,10 +46,11 @@ function __check_for_filesystem() {
4646
function __upgrade() {
4747
# setup downloader
4848
if ! command -v axel >> /dev/null; then
49-
apt install axel
49+
apt install axel -y
5050
fi
51+
5152
mkdir -p "${CACHE_ROOT}"
52-
axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/version || {
53+
axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/version >> /dev/null || {
5354
echo "Error"; exit 1
5455
}
5556

@@ -58,11 +59,13 @@ function __upgrade() {
5859
rm -rf "${CACHE_ROOT}"
5960

6061
if [ "$origin_version" -gt "$version" ]; then
61-
echo "upgrdae avalibe to \e[1;32${origin_version}\e[0m"
62+
echo -e "upgrdae avalibe to \e[1;32mV${origin_version}\e[0m"
6263
elif [ "$origin_version" -eq "$version" ]; then
63-
echo "You are on latest version \e[1;32${origin_version}\e[0m]]"
64+
echo -e "You are on latest version \e[1;32mV${origin_version}\e[0m"
65+
exit 0
6466
else
6567
echo "Upgrader hit unexpected condition..."
68+
exit 1
6669
fi
6770

6871
if start_upgrade; then
@@ -77,7 +80,7 @@ function __upgrade() {
7780

7881
function start_upgrade() {
7982
mkdir -p "${CACHE_ROOT}"
80-
axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/etc/scripts/upgrade_patch/upgrade.sh || {
83+
axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/etc/scripts/upgrade_patch/upgrade.sh >> /dev/null || {
8184
echo "Error"; exit 1
8285
}
8386
bash -x upgrade.sh || {
@@ -138,7 +141,7 @@ function __help()
138141
echo -e "Join the community and leave at DISCORD -> $SOCIAL_PLATFORM"
139142
}
140143

141-
if [ $# -eq 0 ]; then
144+
if [ $# -ge 1 ]; then
142145
case "$1" in
143146
upgrade) __upgrade;;
144147
--enable-dbus) shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap ;;

0 commit comments

Comments
 (0)