Skip to content

Commit 19312b3

Browse files
committed
ksau, setup: Unify Termux
1 parent 6e664f8 commit 19312b3

File tree

6 files changed

+22
-274
lines changed

6 files changed

+22
-274
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
LINT_FILES := setup \
22
setup-root \
3-
ksau \
4-
termux/setup \
5-
termux/ksau \
3+
ksau
64

75
lint:
86
shfmt -i 4 -w $(LINT_FILES)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ curl -s https://raw.githubusercontent.com/noobyysauraj/global_index_source/maste
1818

1919
### For Termux user.
2020
```
21-
curl -s https://raw.githubusercontent.com/noobyysauraj/global_index_source/master/termux/setup | bash
21+
curl -s https://raw.githubusercontent.com/noobyysauraj/global_index_source/master/setup | bash
2222
```
2323
### Once tool is installed, run setup.
2424
```

ksau

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ readonly status_dir="$(mktemp -d)"
2121
trap "rm -rf $status_dir" EXIT
2222

2323
dependencies() {
24+
if declare -p TERMUX_VERSION &>/dev/null; then
25+
echo "Starting Installation...."
26+
pkg install rclone jq -y >/dev/null 2>&1
27+
echo ""
28+
echo "${orange}Installation Completed. ${normal}"
29+
return
30+
fi
31+
2432
echo ""
2533
echo "Make sure you have sudo privilages"
2634
echo "This will only work for Linux/macOS/BSD systems."

setup

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ orange=$(echo -en "\e[33m")
66
aqua=$(echo -en "\e[36m")
77
lightgreen=$(echo -en "\e[92m")
88

9-
echo "Make sure you have sudo privilages"
9+
if declare -p TERMUX_VERSION &>/dev/null; then
10+
SUDO=""
11+
INSTALLDIR=$PREFIX/bin/ksau
12+
else
13+
SUDO=sudo
14+
INSTALLDIR=/usr/local/bin/ksau
15+
echo "Make sure you have sudo privileges"
16+
fi
17+
1018
rm ksau >/dev/null 2>&1
11-
sudo rm /usr/local/bin/ksau >/dev/null 2>&1
19+
$SUDO rm $INSTALLDIR >/dev/null 2>&1
1220
curl https://raw.githubusercontent.com/noobyysauraj/global_index_source/master/ksau >ksau 2>/dev/null
13-
sudo mv ksau /usr/local/bin
14-
chmod +x /usr/local/bin/ksau
21+
$SUDO mv ksau $INSTALLDIR
22+
chmod +x $INSTALLDIR
1523

1624
if ! command -v ksau &>/dev/null; then
1725
echo "${orange}Installation Failed !!!"

termux/ksau

Lines changed: 0 additions & 235 deletions
This file was deleted.

termux/setup

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)