Skip to content

Instantly share code, notes, and snippets.

@veez21
Created April 26, 2020 14:18
Show Gist options
  • Save veez21/f00d05f776870be3151ab954c04239cd to your computer and use it in GitHub Desktop.
Save veez21/f00d05f776870be3151ab954c04239cd to your computer and use it in GitHub Desktop.
echo "Installing FreeMem (drop_caches) by veez21 for Termux"
dir=/data/data/com.termux/files
dir2=$dir/home/.freemem
[ -d "$dir" ] || { echo "Termux not installed!"; exit 1; }
mkdir -p $dir2
cd $dir2
curl -s -o "freemem.sh" https://gist.githubusercontent.com/veez21/a7a8483b88fced8af7b8ce59d50f0663/raw/freemem
chmod a+x freemem.sh
if ! grep fmem $dir/home/.bashrc;
then
echo "
fmem() {
su -c ../home/.freemem/freemem.sh
}
" >> $dir/home/.bashrc
fi
source $dir/home/.bashrc
echo "Done"
echo "Enter 'fmem' to free memory."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment