-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lamp-upgrade
executable file
·74 lines (67 loc) · 2.27 KB
/
lamp-upgrade
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
#!/bin/bash
#
# Upgrade all the software.
#
# 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 : 1.1.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/upgrade_software.sh
source "${scripts}"/upgrade_software.sh # Run upgrade script.
printf "${GRN}%s\\n" "$TOP"
printf '* %-76s %s\n' "Congratulations! You have successfully upgraded all the software." "*"
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 ./lamp-upgrade" "*"
printf "%s${NOC}\\n\\n" "$BOTTOM"
exit 1
fi
#######################################
# Runs the main upgrade.
#######################################
main_application
exit 0