Skip to content

Commit 1efa080

Browse files
Merge pull request #30 from RandomCoderOrg/fix01-patch
Fix01 patch
2 parents a2effc6 + e9ed0b0 commit 1efa080

File tree

2 files changed

+58
-24
lines changed

2 files changed

+58
-24
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,12 @@ A note before you try
4040

4141
## Getting Sources and install scripts
4242
```bash
43-
# remove ubuntu-on-android folder if exists
44-
rm -rf ubuntu-on-android
45-
# install dependencies
46-
apt update; apt upgrade -y ; apt install git -y
47-
# clone the code
48-
git clone https://github.com/RandomCoderOrg/ubuntu-on-android
43+
# download installer
44+
curl -L -o install.sh https://git.io/hippo-installer
4945
# run the installer
50-
cd ubuntu-on-android
5146
bash install.sh
52-
# start the manager for first time (if it can't find any pre-installed fs it automatiaclly starts installing it)
53-
hippo
47+
# Install ubuntu with this command
48+
hippo --install
5449
```
5550
### Basic Usage
5651
| **Command** | **Usage** |

install.sh

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,44 @@
44
# * Script V01
55
#
66

7+
version="01"
8+
9+
# * Deafault color is Blue
10+
RST="\e[0m"
11+
RED="\e[1;31m" # *This is bold
12+
GREEN="\e[1;32m"
13+
BLUE="\e[34m"
14+
DC=${BLUE}
15+
16+
#GREEN_THIN="\e[32m"
17+
18+
# * Used for testing
19+
if [ -n "$HIPPO_BRANCH" ]; then
20+
BRANCH="$HIPPO_BRANCH"
21+
fi
22+
723

824
CACHE_ROOT="${HOME}/.uoa-cache-root"
925
TPREFIX="/data/data/com.termux/files"
10-
BIN_DIR="${TPREFIX}/usr/bin"
26+
#BIN_DIR="${TPREFIX}/usr/bin"
1127
INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs"
1228
HIPPO_DIR="${INSTALL_FOLDER}/hippo"
13-
SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro/"
29+
SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro"
1430
HIPPO_REPO_URL="https://github.com/RandomCoderOrg/ubuntu-on-android"
1531
FSM_URL="https://github.com/RandomCoderOrg/fs-manager-hippo"
1632

17-
die () { echo -e "\e[1;32m Error ${*}\e[0m";exit 1 ;:;}
18-
shout () { echo -e "${*}\e[0m";:; }
33+
die () { echo -e "${RED}Error ${*}${RST}";exit 1 ;:;}
34+
warn () { echo -e "${RED}Error ${*}${RST}";:;}
35+
shout () { echo -e "${DC}-----";echo -e "${*}";echo -e "-----${RST}";:; }
36+
lshout () { echo -e "${DC}";echo -e "${*}";echo -e "${RST}";:; }
37+
38+
39+
shout "\e[1;32m Hippo Installer v${version}"
40+
sleep 2
1941

2042
#
2143
# * die function exits program
22-
# * shout just echo the messege out
44+
# * shout just echo the messege out (fancy one line 😁)
2345
#
2446

2547
function setup_and_clone()
@@ -32,22 +54,37 @@ function setup_and_clone()
3254
apt install git -y || {
3355
die "Git installation failed"
3456
}
57+
lshout "Done..."
3558
fi
3659

3760
if ! command -v pulseaudio >> /dev/null; then
3861
shout "Installing pulseaudio..."
3962
apt install pulseaudio -y || {
4063
die "pulseaudio installation failed"
4164
}
65+
lshout "Done..."
4266
fi
4367

4468
if ! command -v pv >> /dev/null; then
4569
shout "installing pv.."
4670
apt install pv -y
4771
fi
4872

49-
git clone ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
50-
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
73+
if [ -d "${CACHE_ROOT}" ]; then
74+
shout "Removing old cache......."
75+
rm -rf "${CACHE_ROOT:?}/"*
76+
lshout "Done..."
77+
fi
78+
79+
shout "Cloning code from Github........."
80+
if [ -n "${BRANCH}" ]; then
81+
git clone -b "${BRANCH}" ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
82+
git clone -b "${BRANCH}" ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
83+
else
84+
git clone ${HIPPO_REPO_URL} "${CACHE_ROOT}/ubuntu-on-android" || die "failed to clone repo"
85+
git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo"
86+
fi
87+
lshout "Done..."
5188

5289
install
5390
}
@@ -57,7 +94,13 @@ function install()
5794
####
5895
# * Step 1
5996

60-
shout "setting up implant..."
97+
shout "setting up proot-distro hippo implant..."
98+
99+
sleep 3
100+
101+
if [ -f ${SCRIPT_DIR} ]; then
102+
mv ${SCRIPT_DIR} "${SCRIPT_DIR}1"
103+
fi
61104

62105
if [ -f "${CACHE_ROOT}"/ubuntu-on-android/hippo.sh ]; then
63106
cp "${CACHE_ROOT}"/ubuntu-on-android/hippo.sh ${SCRIPT_DIR}
@@ -70,15 +113,11 @@ function install()
70113
oldpwd="$(pwd)"
71114
cd "${CACHE_ROOT}"/fs-manager-hippo || die "failed to cd ..."
72115
bash install.sh || die "failed to install manager..."
73-
cd "${oldpwd}"
116+
cd "${oldpwd}" || die "error"
74117
fi
75118

76-
shout
77-
shout "setup complete..."
78-
shout "Now you can install and login with comand\e[1;32hippo"
79-
shout "for info use hippo --help"
80-
shout
81-
119+
120+
shout "setup complete...\nNow you can install and login with comand ${GREEN}hippo${DC} \nfor info use hippo --help"
82121
exit 1
83122

84123
}

0 commit comments

Comments
 (0)