-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·81 lines (75 loc) · 2.93 KB
/
install
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
#!/bin/bash
#
# The main install script that sets up and installs everything required
# by the application.
#
# Copyright: Copyright 2018-2020 Justin Hartman (https://justinhartman.co)
# Author : Justin Hartman <[email protected]> (https://justinhartman.co)
# License : https://opensource.org/licenses/AGPL-3.0 AGPL-3.0
# Version : 1.2.2
# Link : https://github.com/justinhartman/lamp-ssl
# Since : 0.4.0
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#######################################
# Includes the colour palette and
# other global variables
# Globals:
# None
# Arguments:
# None
# Returns:
# Variables
#######################################
global_includes() {
source ./scripts/globals.sh
source ./scripts/colour_palette.sh
}
#######################################
# This is the main application thread.
# Globals:
# None
# Arguments:
# None
# Returns:
# String Multi-interactive messages.
#######################################
main_application() {
# shellcheck source=scripts/setup_ssl.sh
source "${scripts}"/setup_ssl.sh # Setup self-signed SSL
# shellcheck source=scripts/apache_config.sh
source "${scripts}"/apache_config.sh # Configure Apache 2
# shellcheck source=scripts/thirdparty_install.sh
source "${scripts}"/thirdparty_install.sh # Install third-party tools
# shellcheck source=scripts/folder_ownership.sh
source "${scripts}"/folder_ownership.sh # Set correct folder ownership
printf "${GRN}%s\\n" "${TOP}"
printf '* %-76s %s\n' "Congratulations! You have successfully setup your localhost configuration." "*"
printf '* %-76s %s\n' "All the files you will need to edit are contained in:" "*"
printf '* %-76s %s\n' "${dist}" "*"
printf '* %-76s %s\n' "This includes any websites you add as well as direct access to the SSL," "*"
printf '* %-76s %s\n' "Apache, Adminer, PHP, phpMyAdmin, Error Pages and Hosts folders." "*"
printf "%s${NOC}\\n\\n" "${BOTTOM}"
}
global_includes # Includes global variables and file paths.
if ! [ "$(id -u)" = 0 ]; then
printf "${RED}%s\\n" "${TOP}"
printf '* %-76s %s\n' "This needs to be run as root. Please run it again using 'sudo' by executing" "*"
printf '* %-76s %s\n' "the following command: $ sudo ./install" "*"
printf "%s${NOC}\\n\\n" "${BOTTOM}"
exit 1
fi
main_application # Runs the main install
exit 0