-
Notifications
You must be signed in to change notification settings - Fork 0
/
MySh.sh
executable file
·165 lines (147 loc) · 3.25 KB
/
MySh.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
#! /bin/sh
# Copyright 2018 LEGAGNEUR Matthieu
# GNU GPL V3 https://www.gnu.org/licenses/gpl.txt
mysh_read=0
mysh_var_exit=0
mysh_var_uptodate=0
mysh_var_env_base=0
mysh_var_env_phpdev=0
mysh_main(){
clear
if test "$USER" != "root"
then
echo "MySH require sudo / root !"
mysh_var_exit=1
fi
while test $mysh_var_exit -eq 0
do
clear
mysh_menu
done
}
mysh_menu(){
echo "Welcome in MySH by LEGAGNEUR Matthieu\n"
echo "1) Update Ubuntu"
echo "2) Install env base"
echo "3) Install env gamer"
echo "4) Install env phpdev"
echo "5) Install env DWF"
echo "6) Fix audio"
echo "7) Install pkg OpenOffice"
echo "8) Install pkg compiz"
echo "0) Exit"
echo -n "Enter a number : "
read mysh_read
case $mysh_read in
1) mysh_update;;
2) mysh_install_env_base;;
3) mysh_install_env_gamer;;
4) mysh_install_env_phpdev;;
5) mysh_install_env_dwf;;
6) mysh_fix_audio;;
7) mysh_pkg_OpenOffice;;
8) mysh_pkg_compiz;;
0) mysh_exit;;
esac
}
mysh_press_enter(){
if test $mysh_read -eq $1
then
echo "\nPress ENTER for back to menu"
read mysh_useless
fi
}
mysh_is_uptodate(){
if test $mysh_var_uptodate -eq 0
then
mysh_update
fi
}
mysh_base_instaled(){
if test $mysh_var_env_base -eq 0
then
mysh_install_env_base
fi
}
mysh_phpdev_instaled(){
if test $mysh_var_env_phpdev -eq 0
then
mysh_install_env_phpdev
fi
}
mysh_update(){
apt update
apt -y upgrade
apt -y dist-upgrade
apt -y autoremove
do-release-upgrade
mysh_var_uptodate=1
mysh_press_enter 1
}
mysh_install_env_base(){
mysh_is_uptodate
apt -y install clamav clamav-daemon clamav-freshclam clamtk default-jre default-jdk firefox-locale-fr thunderbird-locale-fr vlc libdvd-pkg
dpkg-reconfigure libdvd-pkg
mysh_var_env_base=1
mysh_press_enter 2
}
mysh_install_env_gamer(){
mysh_base_instaled
apt -y install playonlinux steam
apt -y install winetricks msitools
winetricks dotnet48
mysh_press_enter 3
}
mysh_install_env_phpdev(){
mysh_base_instaled
apt -y install tasksel netbeans fail2ban git
tasksel
apt-get -y install phpmyadmin
echo -n "git user.name : "
read git_user_name
echo -n "git user.email : "
read git_user_email
git config --global user.name "$git_user_name"
git config --global user.email "$git_user_email"
mysh_var_env_phpdev=1
mysh_press_enter 4
}
mysh_install_env_dwf(){
mysh_phpdev_instaled
apt-get -y install php7.2-tidy php7.2-gmp php7.2-sqlite3
cd /var/www
git init
git pull https://github.com/legagneur-matthieu/DevWebFramework.git
rm html/index.html
chmod -R 775 /var/www/
chgrp -R www-data /var/www/
service apache2 restart
mysh_press_enter 5
}
mysh_fix_audio(){
mysh_is_uptodate
apt -y install alsa alsa-* pulseaudio
mysh_press_enter 6
}
mysh_pkg_OpenOffice(){
mkdir AOO/
cd AOO/
wget https://netix.dl.sourceforge.net/project/openofficeorg.mirror/4.1.5/binaries/fr/Apache_OpenOffice_4.1.5_Linux_x86-64_install-deb_fr.tar.gz -O AOO.tar.gz
tar xvf AOO.tar.gz
dpkg -i fr/DEBS/*.deb
dpkg -i fr/DEBS/desktop-integration/*.deb
cd ../
rm -fr AOO/
mysh_press_enter 7
}
mysh_pkg_compiz(){
mysh_base_instaled
apt -y install compiz compizconfig-settings-manager compiz-plugins compiz-plugins-extra compiz-plugins-main
mysh_press_enter 8
}
mysh_exit(){
clear
echo "MySH : Good Bye !"
mysh_var_exit=1
}
mysh_main