-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapt.sh
executable file
·97 lines (80 loc) · 1.95 KB
/
apt.sh
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
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
# Reset text attributes to normal + without clearing screen.
alias Reset="tput sgr0"
# Color-echo.
# arg $1 = message
# arg $2 = Color
cecho() {
echo -e "${2}${1}"
# Reset # Reset to normal.
return
}
if hash apt-get 2>/dev/null; then
cecho "apt has been installed, just continue install ..." $green
else
cecho "no apt found! exit ..." $yellow
exit
fi
# Ask for the administrator password upfront.
sudo -v
cecho "config the DNS" $yellow
echo ""
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo ""
cecho "Now time to install my favorate tools ..." $yellow
apps=(
# Utilities
build-essential
libncurses5-dev
libreadline-dev
libpcre3-dev
libssl-dev
libssh-dev
libgnutls28-dev
openssh-server
openssl
make
cmake
g++
autoconf
libgtk-3-dev
automake
texinfo
pkg-config
libxml2
)
for item in ${apps[@]}; do
cecho "> ${item}" $magenta
done
echo ""
select yn in "Yes" "No"; do
case $yn in
Yes )
cecho "Ok! installing apps, please wait ... " $yellow
sudo apt-get install -y ${apps[@]}
break;;
No ) break;;
esac
done
echo ""
cecho "the ensential tools already installed just continue ===>" $green
echo ""
echo -e "\033[40;32m install the z, refer: https://github.com/rupa/z/blob/master/z.sh \033[0m"
git clone https://github.com/rupa/z ~/z
. ~/z/z.sh
echo ""
echo -e "\033[40;32m install liquidprompt \033[0m"
git clone https://github.com/nojhan/liquidprompt.git ~/.liquidprompt
source ~/.liquidprompt/liquidprompt
cecho "Done, Happy Hacking At the Speed Of The Thought !!!" $green