-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
57 lines (48 loc) · 1.38 KB
/
install.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
MONKEY='\U1F435'
SUCCESS='\U1F389'
COFFEE='\U2615'
WORLD='\U1F30D'
ALARM='\U1F6A8'
UNAME=$(uname -a)
# Determinando la distro y versión de sistema operativo.
if [[ $UNAME == *"Debian"* ]]; then
WB_SO="Debian"
WB_VER=$(grep VERSION= /etc/os-release | cut -f2 -d'=' | sed 's/\"//g')
elif [[ $UNAME == *"Ubuntu"* ]]; then
WB_SO="Ubuntu"
WB_VER=$(grep DISTRIB_RELEASE /etc/lsb-release | cut -f2 -d'=')
elif [[ $UNAME == *"arm"* ]]; then
WB_SO="Raspbian"
WB_VER=$(grep VERSION= /etc/os-release | cut -f2 -d'=' | sed 's/\"//g')
else
echo "No es posible instalar en este sistema"
echo "uname -a = ${UNAME}"
exit
fi
echo -e "El SO es compatible! ${SUCCESS}"
echo "SO: ${WB_SO}"
echo -e "Version: ${WB_VER}\n"
# El script sólo debe correrse con privilegios sudo (pero no root)
if [[ $EUID = 0 ]]; then
if [[ $SUDO_USER == "" ]]; then
echo -e "No instales este software con el usuario root"
echo "Por favor instala usando sudo."
echo -e "Saliendo del instalador"
exit
fi
else
echo -e "Por favor instala usando sudo"
echo -e "Saliendo del instalador"
exit
fi
if [[ $WB_SO == "Raspbian" ]]; then
touch /boot/ssh
fi
bash $(dirname "$0")/00.init.sh
bash $(dirname "$0")/01.lamp-install.sh
bash $(dirname "$0")/02.nas.sh
bash $(dirname "$0")/03.proxy.sh
bash $(dirname "$0")/04.vpn.sh
bash $(dirname "$0")/04.01.vpn-clientes.sh
bash $(dirname "$0")/99.post-install.sh
reboot