Skip to content

Commit 7368679

Browse files
committed
Improved setup.sh
1 parent 5b9b1c3 commit 7368679

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

setup.sh

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

33
# sudo check
4-
if [ "$(id -u)" != "0" ]; then
5-
if ! command -v sudo >/dev/null 2>&1; then
6-
echo "This script requires sudo or root privileges but none present."
7-
exit 1
8-
else
9-
SUDO="$(command -v sudo)"
4+
if [ "$(uname -o)" = "Android" ]; then
5+
echo "Running in Termux"
6+
apt update
7+
apt install debootstrap which -y
8+
else
9+
if [ "$(id -u)" != "0" ]; then
10+
if ! command -v sudo >/dev/null 2>&1; then
11+
echo "This script requires sudo or root privileges but none present."
12+
exit 1
13+
else
14+
SUDO="$(command -v sudo)"
15+
fi
1016
fi
17+
$SUDO apt update
18+
$SUDO apt install -y qemu-user-static binfmt-support
1119
fi
12-
13-
deps="qemu-user-static binfmt-support"
14-
15-
$SUDO apt install -y "$deps"

0 commit comments

Comments
 (0)