forked from crossedheadx/post-install-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostInstall.sh
253 lines (240 loc) · 5.53 KB
/
postInstall.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#!/bin/bash
## HAL9000 v0.004 install tools
## auth: Cesare Vigliani aka crossedhead aka crossedheadx
## github https://github.com/crossedheadx
##Post install tools
##functions
function debian {
echo 'Password'
user = $USER
release = $(lsb_release)
su -c 'apt-get install sudo && usermod -aG sudo $user && visudo' #TODO: automate better this part
echo 'Password, again'
## add repos
sudo apt-get update
sudo apt-get upgrade -y
clear
# install some stuff
sudo apt-get install -y git curl vlc firmware-realtek firmware-iwlwifi firmware-linux-non-free fslint rsnapshot mc xsane $release-backports libreoffice htop nmap gdebi
echo "Job Completed!"
sleep 1
clear
}
function buntu {
release = $(lsb_release -sc)
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $release main universe restricted multiverse"
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $release partner"
echo 'Enabled server Universe and partners, much more software!'
clear
while true;
do
echo 'Wait, is this an Ubuntu (o)fficial or (d)erivate?'
read ris
##nested controls to insert correct data between d or o && x l k
if [[ $ris = "o" || $ris = "d" ]]; then
while true;
do
case $ris in
u)
suffix="ubuntu"
break
;;
d)
echo 'which of these?'
echo '(x)ubuntu'
echo '(l)ubuntu'
echo '(k)ubuntu'
read ri
case $ri in
x)
suffix='xubuntu'
;;
l)
suffix='lubuntu'
;;
k)
suffix='kubuntu'
;;
*)
echo 'bad answer'
clear
;;
esac
if [[ $ri = "x" || $ri = "l" || $ri = "k" ]]; then
break
fi
;;
esac
done
break
fi
done
## simple update check
sudo apt update
sudo apt dist-upgrade -y
clear
sudo apt install -y $suffix-restricted-extras p7zip ntp ssh vlc gdebi synaptic build-essential gparted unetbootin language-pack-it language-pack-gnome-it aspell-it myspell-it libdvd-pkg libdvdread4 python3
clear
sudo dpkg-reconfigure libdvd-pkg
clear
sudo apt-get install openjdk-8-jre icedtea-8-plugin
clear
if [ $suffix ='ubuntu' ]; then
sudo apt install unity-tweak-tool unity-tweak -y
clear
fi
echo 'Casual crash error suppression'
sleep 0.8
sudo sed -i "s/enabled=1/enabled=0/" /etc/default/apport
echo 'P2P software needed (torrent, eMule)? [y/N]'
if [ $risp = 'y']; then
echo 'hai fastweb a casa? [y/N] (for italians users)'
read ris
if [$ris = 'y']; then
sudo apt install amule-adunanza -y
else
sudo apt install amule -y
fi
fi
clear
echo 'Complete LibreOffice needed? [y/N]'
read risp
if [ $risp = 'y' ]; then
sudo apt install libreoffice-base -y
fi
clear
echo 'Graphic/editing video/audio packages needed? [y/N]'
read risp
if [ $risp = 'y' ];then
clear
echo 'All right, choose what you need|'
echo '1) Audio pkgs |'
echo '2) Graphics/publishing pkgs |'
echo '3) Video pkgs |'
echo '4) All toghether |'
echo 'multiple choices allowed (ex.23 or 12)|'
audio=' ubuntustudio-audio ubuntustudio-audio-plugins'
graph=' ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-photography ubuntustudio-publishing gimp-plugin-registry krita'
video=' ubuntustudio-video'
read extra
case $extra in
1)
sudo apt install $audio -y
;;
2)
sudo apt install $graph -y
;;
3)
sudo apt install $video -y
;;
12)
sudo apt install $audio $graph -y
;;
13)
sudo apt install $audio $video -y
;;
23)
sudo apt install $graph $video -y
;;
4)
sudo apt install $audio $graph $video -y
;;
*)
echo 'Combination not allowed'
sleep 1
clear
;;
esac
clear
fi
clear
echo 'Job completed!'
sleep 1
echo '<<--'
sleep 1.5
}
function aliases {
echo "alias ll='ls -l'" >> $HOME/.bashrc
echo "alias la='ls -A'" >> $HOME/.bashrc
echo "alias l='ls -CF'" >> $HOME/.bashrc
echo "alias rm='rm -i'" >> $HOME/.bashrc
echo "alias cp='cp -i'" >> $HOME/.bashrc
echo "alias mv='mv -i'" >> $HOME/.bashrc
sleep 0.5
echo "Now your shell is more cool!"
}
##main menu
while true;
do
clear
echo '### --- Install Tool v3 --- ###'
echo ' # post install commands set #'
echo '1) - Debian essentials'
echo '2) - *buntu essentials'
echo '3) - Fedora/CentOS/RHEL essentials'
echo '4) - OpenSuSE essentials'
echo '5) - Arch install guide'
echo '6) - Alpine Linux setup'
echo '7) - Cool aliases for your shell!'
echo '8) - Exit'
echo -ne '-->'
read IT
case $IT in
1)
clear
echo 'building'
sleep 1
clear
;;
2)
clear
echo '*buntu essentials'
sleep 0.5
echo 'start post installation'
sleep 1
clear
echo -ne '-->>'
buntu
;;
3)clear
echo 'building'
sleep 1
clear
;;
4)clear
echo 'building'
sleep 1
clear
;;
5)clear
echo 'building'
sleep 1
clear
;;
6)clear
echo 'building'
sleep 1
clear
;;
7)
echo 'Cool aliases! Yea!'
sleep 1
echo 'begin'
clear
echo -ne '-->>'
aliases
;;
8)
clear
echo -ne 'Exiting'
sleep 2
clear
exit
;;
*)
clear
echo -ne 'bad command!'
sleep 0.5
;;
esac
done