-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-script
More file actions
executable file
·35 lines (29 loc) · 1.04 KB
/
install-script
File metadata and controls
executable file
·35 lines (29 loc) · 1.04 KB
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
#! /data/data/com.termux/files/usr/bin/bash
# TODO: add ability to download updates from git
log="install-script-log.log"
truncate --size 0 "$log"
# small function to improve logging and cleaner code
LogAndExecute() {
echo "$ $@" >>"$log"
$@ >>"$log"
}
trap 'echo "Error while installing dependencies, check the log"; exit 1' ERR INT
echo "Installing dependencies..."
LogAndExecute "apt-get update"
LogAndExecute "apt-get install -y python jq ffmpeg git termux-api"
LogAndExecute "pip install --upgrade -q pip yt-dlp"
echo "Install the Termux:API app to get download notifications."
trap - ERR INT
[[ -d ~/bin ]] || mkdir ~/bin
if ! { echo "$PATH" | grep -q '/com.termux/files/home/bin'; }; then
echo "Adding $HOME/bin to the PATH"
cat >>~/.bashrc << EOF
if [[ -d ~/bin ]]; then
PATH=~/bin:"$PATH"
fi
EOF
fi
echo "Installing symlinks"
ln --symbolic --relative --backup=simple ~/termux-url-script/termux-url-opener ~/bin/termux-url-opener
ln --symbolic --relative --backup=simple ~/termux-url-script/termux-url-opener ~/bin/termux-file-editor
echo "Done"