-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·54 lines (46 loc) · 1.24 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
confirm() {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure?} [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
export TERMUX_ADB;
pkg install fakeroot || exit;
if [ ! "$TERMUX_ADB" ]; then
TERMUX_ADB="$(command -v termux-adb)"
fi
if [ ! -f "$TERMUX_ADB" ]; then
curl -s https://raw.githubusercontent.com/nohajc/termux-adb/master/install.sh | bash || exit;
$TERMUX_ADB
fi
if [ ! -f "$TERMUX_ADB" ]; then
echo "Failed to install termux-adb: $TERMUX_ADB";
exit;
fi
if confirm "Is your device running Samsung's Android?"; then
if confirm "Replace 'adb' with 'termux-adb'? (RECOMMENDED)"; then
cp ./adb-samsung.sh $PREFIX/bin/adb;
else
echo "Set up ADB before each use of gnirehtet:"
echo "";
echo "ADB=adb-samsung.sh ./gnirehtet run";
echo "";
fi
else
if confirm "Create a symbolic link for 'adb' command?"; then
ln -s "$PREFIX/bin/termux-adb" "$PREFIX/bin/adb";
else
echo "Set up ADB before each use of gnirehtet:";
echo "";
echo "ADB=termux-adb ./gnirehtet run";
echo "";
fi
fi
echo "Done";