-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtermux_setup
executable file
·140 lines (93 loc) · 2.32 KB
/
termux_setup
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# Author: Samuel Anyaele
# Source: TheMobileProf.com
# Constants ########
readonly WAITLONG=3
readonly WAITSMALL=1
####################
# main function
main(){
# Update Package Termux source mirror
# update_mirror
echo ">>> Updating Termux ..."
# Answer "Y" to all prompts
yes Y | pkg update
echo ">>> Installing Unzip..."
echo "# Unzip is an archiving and extraction package"
install unzip
# PACKAGE INSTALLATIONS #
echo ">>> Installing openssl and openssh ..."
echo "# Enable secure remote connection from a terminal"
install openssl
install openssh
# Configure SSH Key
cat /dev/zero | ssh-keygen -q -N ""
echo ">>> Installing Git and Gh..."
echo "# Git is a Version Control system for storing and distributing software, and Gh is the official Github CLI"
install git
install gh
# Configure git
configure_git
# Configure welcome script
welcome_script
# Setup Storage symlink on Termux home
echo ">>> Please accept the Popup asking for permission"
echo "# this configures storage link for your file manager"
sleep $WAITLONG
termux-setup-storage
echo ">>> Install Zsh"
sleep $WAITLONG
bash -c "$(curl -fsSL https://git.io/oh-my-termux)"
}
# The installation function
install()
{
sleep $WAITLONG
pkg install -y $1
}
# Configure git
configure_git(){
echo ">>> Now let's configure Git ..."
sleep $WAITSMALL
echo "What is your name?"
read USERNAME
git config --global user.name "$USERNAME"
echo "What is your email? (preferably github.com email)"
read USEREMAIL
git config --global user.email $USEREMAIL
# Merge setup
git config --global pull.rebase false
}
# Welcome Script
welcome_script()
{
sleep $WAITSMALL
echo "Changing Welcome Page"
sleep $WAITSMALL
#backup existing file
cd ~
cp ../usr/etc/motd ../usr/etc/motd.bak
#make new welcome file
echo "xxxxxxxxxxxxxxxxx
Hi $USERNAME!
Welcome to Termux
xxxxxxxxxxxxxxxxx
TheMobileProf.com Scripts Repo:
https://github.com/themobileprof/scripts
" > ../usr/etc/motd
cd -
}
#########################################
####### Main program starts below #######
#########################################
echo ">>> TheMobileProf.com recommended Setup for Termux"
echo "Press Y/y to continue:"
read INSTALL
# Only continue if user says Yes
if [ ${INSTALL,,} != 'y' ]
then
exit 0
else
# Start main function if user says yes
main
fi