Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Allows users to change their installation location and nameserver. #121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/data/data/com.termux/files/usr/bin/bash
folder=ubuntu-fs
read -p "install to(default: ./ubuntu-fs):" dir
if [ ! -n "$dir" ]; then
folder="$dir"
else
folder="ubuntu-fs"
fi
if [ -d "$folder" ]; then
first=1
echo "skipping downloading"
Expand Down Expand Up @@ -29,8 +34,13 @@ if [ "$first" != 1 ];then
cd "$folder"
echo "decompressing ubuntu image"
proot --link2symlink tar -xf ${cur}/${tarball} --exclude='dev'||:
read -p "enter your nameserver address(default: 1.1.1.1):" nameserver
echo "fixing nameserver, otherwise it can't connect to the internet"
echo "nameserver 1.1.1.1" > etc/resolv.conf
if [ ! -n "$nameserver" ]; then
echo "nameserver $nameserver" > etc/resolv.conf
else
echo "nameserver 1.1.1.1" > etc/resolve.conf
fi
cd "$cur"
fi
mkdir -p binds
Expand Down