forked from Patrick-81/NAFABox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install.sh
executable file
·127 lines (112 loc) · 3.89 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
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
################################################
# Under GPL license
# https://www.gnu.org/licenses/gpl.html
# Authors: Sébastien Durand
#
# On Sept 02 2018
# V0.1
################################################
#!/bin/bash -i
server_choice=$1
if [[ -z "$nafabox_path" ]]
then
echo "Run first Pre_Install.sh and reload Terminal"
else
dirinstall=$nafabox_path
######
# detect language
######
source ${dirinstall}/detect_language.sh
#####
# Choix du mode d'installation
#####
if ${french}
then
title[0]="Choix du type d'installation :"
title[1]="Menu"
menu_text="Choisisez le type d'installation NAFABox désiré.
Installation par defaut: sans interface graphique,
fonctions réseaux, phd2
et kstars/ekos/indi
Installation server: sans interface graphique,
fonction necessitant pas
d'intreface graphique
pour le pilotage a distance
Installation custom: avec interface graphique,
choisir ce que vous voulez
installer"
choice[0]="Installation par defaut"
choice[1]="Installation mode server"
choice[2]="Installation custom"
else
title[0]="Choice installation type :"
title[1]="Menu"
menu_text="Choose the desired NAFABox installation type.
Default installation: without graphical interface,
network functions, phd2 and
kstars / ekos / indi
Installation server: without graphical interface,
functions that do not require
a graphical interface for
remote control
Custom installation: with graphical interface,
choose what you want to install"
choice[0]="Default installation"
choice[1]="Installation server"
choice[2]="Custom installation"
fi
if [[ ${server_choice} == "" ]]
then
# trap sert à afficher proprement les démarcations entre les applications.
touch /tmp/dialogtmp && FICHTMP=/tmp/dialogtmp
trap "rm -f ${FICHTMP}" 0 1 2 3 5 15
# dialog for inital choice
dialog --backtitle "${title[0]}" --title "${title[1]}" \
--menu "$menu_text" 22 60 6 \
"default" "${choice[0]}" \
"server" "${choice[1]}" \
"custom" "${choice[2]}" 2> ${FICHTMP}
# traitement de la réponse
if [[ $? == 0 ]]
then
for i in `cat ${FICHTMP}`
do
case ${i} in
default)
server_choice="default" ;;
server)
server_choice="server" ;;
custom)
server_choice="custom" ;;
esac
done
else
exit
fi
fi
figlet -k NAFABox
echo "================================================="
echo "================================================="
if [[ ${server_choice} == "server" ]]
then
echo "############################"
echo "## install in server mode ##"
echo "############################"
${dirinstall}/install_conf.sh initial ${server_choice} | tee -a "$dirinstall/nafabox.log"
elif [[ ${server_choice} == "default" ]]
then
echo "############################"
echo "## install in default mode ##"
echo "############################"
${dirinstall}/install_conf.sh initial ${server_choice} | tee -a "$dirinstall/nafabox.log"
elif [[ ${server_choice} == "custom" ]]
then
echo "############################"
echo "## install in custom mode ##"
echo "############################"
${dirinstall}/install_conf.sh initial | tee -a "$dirinstall/nafabox.log"
else
echo "wrong install mode"
exit
fi
fi