dotfiles/config/scripts/install-termux

44 lines
940 B
Plaintext
Raw Permalink Normal View History

2017-03-27 10:03:44 +02:00
#!/data/data/com.termux/files/usr/bin/env bash
# Setups a Termux system the way I like it
if [ ! -d /data/data/com.termux/files ]; then
echo "This is not a Termux system (or pacman isn't installed)"
return 1
fi
# Configuration
function prompt { # text
while true; do
read -p "$1 [yn] " yn
case $yn in
[Yy]* ) return 1;;
[Nn]* ) return 0;;
* ) echo "Please answer yes or no.";;
esac
done
}
if [ -z $ROOT ]; then
2020-08-08 11:46:33 +02:00
prompt "Is this device rooted and BusyBox installed in /system/bin/?"
2017-03-27 10:03:44 +02:00
ROOT=$?
fi
# Update
apt update
apt upgrade
# (needed for install-prefs)
apt install coreutils
apt install grep
2018-06-24 18:28:37 +02:00
# Used by some of my termux scripts
apt install jq
2017-03-27 10:03:44 +02:00
# Config
touch ~/.hushlogin
if [ $ROOT == 1 ]; then
apt install tsu
2020-08-08 11:46:33 +02:00
echo '/system/bin/mount -o remount,rw /; ln -s /data/data/com.termux/files/usr /usr; /system/bin/mount -o remount,ro /' | tsu
2017-03-27 10:03:44 +02:00
fi