forked from leblanc-simon/FreeInstallServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·65 lines (50 loc) · 1.67 KB
/
install.sh
File metadata and controls
executable file
·65 lines (50 loc) · 1.67 KB
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
#!/bin/bash
#
# This file is part of the FreeInstallServer.
# (c) 2011 Simon Leblanc <contact@leblanc-simon.eu>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# On inclue le fichier de configuration
. "$(pwd)/config.sh"
# On inclue les bibliothèque
. "${LIB_DIRECTORY}/00_load.sh"
# On initialise les répertoires
create_essentials_dirs
# On install dialog si besoin
has_dialog=$(${DIALOG} -v)
if [ "$?" != 0 ]; then
${INSTALL_BIN} install dialog
fi
# On récupère l'ensemble des plugins
plugins=$(ls "${PLUGINS_DIRECTORY}" | sort)
# On demande les plugins a executer
plugin_options=$(list_plugins_for_menu "${plugins}")
choices=$(echo ${plugin_options} | xargs ${DIALOG} --stdout --backtitle "Choisissez les plugins à installer" --title "Plugins à installer" --checklist "Sélectionnez le ou les plugins à installer sur le serveur" 20 61 5)
if [ "${choices}" == "" ]; then
echo "nothing to do"
exit 0
fi
# On affiche les différents écrans d'accueil des plugins
options=()
for choice in ${choices}; do
choice=$(echo ${choice} | sed 's/"//g')
path=$(get_plugin_path ${choice})
include_script ${path}/define.sh
menu="${path}/menu.sh"
if [ -f ${menu} ]; then
title=$(${choice}_get_description)
include_script ${menu}
fi
done
# On execute les différentes installation des plugins
for choice in ${choices}; do
choice=$(echo ${choice} | sed 's/"//g')
path=$(get_plugin_path ${choice})
install="${path}/install.sh"
if [ -f ${install} ]; then
include_script ${install}
${choice}_install ${options[${choice}]}
fi
done