Skip to content

Instantly share code, notes, and snippets.

@mahfuznow
Last active December 7, 2023 12:55
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mahfuznow/c105a9d72b78802f1529eb837073c6e9 to your computer and use it in GitHub Desktop.
Save mahfuznow/c105a9d72b78802f1529eb837073c6e9 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo ""
echo "============================================="
echo "========= Uninstall linux in Termux ========="
echo "============================================="
echo ""
echo ""
echo "==== Choose Uninstallation Option ===="
distro=""
echo " 1) Alpine"
echo " 2) Debian"
echo " 3) Fedora"
echo " 4) Kali"
echo " 5) Manjaro"
echo " 6) Parrot"
echo " 7) Ubuntu"
echo " 8) Ubuntu19"
echo " 9) Ubuntu20"
echo " 10) Void"
read o
case $o in
1) distro="Alpine";;
2) distro="Debian";;
3) distro="Fedora";;
4) distro="Kali";;
5) distro="Manjaro";;
6) distro="Parrot";;
7) distro="Ubuntu";;
8) distro="Ubuntu19";;
9) distro="Ubuntu20";;
10) distro="Void";;
*) echo "invalid option";exit;
esac
echo "《$distro selected》"
installation_dir="$HOME/$distro"
termux_bin="/data/data/com.termux/files/usr/bin/start-${distro,,}"
if [ -d "$installation_dir" ]; then
echo "==== Are you sure to delete 《$installation_dir》folder? ===="
echo " 1) Yes"
echo " 2) No"
read d
case $d in
1) echo "*** Deleting..please wait.."
rm -rf $installation_dir
if [ ! -d "$installation_dir" ]; then
echo "*** Folder Deleted successfully"
if [ -f "$termux_bin" ]; then
rm $termux_bin
if [ ! -f "$termux_bin" ]; then
echo "*** Start command Deleted successfully"
echo ""
echo "============================================="
echo "========= Uninstalled Successfully =========="
echo "============================================="
echo ""
fi
fi
fi
;;
*) echo ""
echo "==== Canceled uninstallation ===="
echo ""
;;
esac
else
echo "Installation directory not found"
fi
@1-1-1-1-1
Copy link

Nice

@1-1-1-1-1
Copy link

r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment