-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-deployment.sh
82 lines (70 loc) · 4.61 KB
/
web-deployment.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
#!/bin/bash
# -----------------------------------------------------------------------------
# Project: Web-Deployment
# File: web-deployment.sh
# -----------------------------------------------------------------------------
# Purpose:
# This file acts as the main entry point for the web deployment project.
#
# Copyright (C) 2024 CARS, The University of Chicago, USA
# Copyright (C) 2024 GSECARS, The University of Chicago, USA
# This project is distributed under the terms of the MIT license.
# -----------------------------------------------------------------------------
# ASCII Header for the script
echo -ne "
------------------------------------------------------------------------------------------------------------------------
██████╗ █████╗ ██████╗ ███████╗
██╔════╝██╔══██╗██╔══██╗██╔════╝
██║ ███████║██████╔╝███████╗
██║ ██╔══██║██╔══██╗╚════██║
╚██████╗██║ ██║██║ ██║███████║
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
██╗ ██╗███████╗██████╗ ██████╗ ███████╗██████╗ ██╗ ██████╗ ██╗ ██╗███╗ ███╗███████╗███╗ ██╗████████╗
██║ ██║██╔════╝██╔══██╗ ██╔══██╗██╔════╝██╔══██╗██║ ██╔═══██╗╚██╗ ██╔╝████╗ ████║██╔════╝████╗ ██║╚══██╔══╝
██║ █╗ ██║█████╗ ██████╔╝█████╗██║ ██║█████╗ ██████╔╝██║ ██║ ██║ ╚████╔╝ ██╔████╔██║█████╗ ██╔██╗ ██║ ██║
██║███╗██║██╔══╝ ██╔══██╗╚════╝██║ ██║██╔══╝ ██╔═══╝ ██║ ██║ ██║ ╚██╔╝ ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║
╚███╔███╔╝███████╗██████╔╝ ██████╔╝███████╗██║ ███████╗╚██████╔╝ ██║ ██║ ╚═╝ ██║███████╗██║ ╚████║ ██║
╚══╝╚══╝ ╚══════╝╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝
Semi-Automated Web-Deployment for CARS
------------------------------------------------------------------------------------------------------------------------
"
# Define colors
NOTICE_COLOR="\033[0;31m"
NO_COLOR="\033[0m"
# Check for elevated privileges
if [ "$EUID" -ne 0 ]; then
echo -e "${NOTICE_COLOR}Please run this script with elevated privileges${NO_COLOR}"
exit 1
fi
# Define directories
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SCRIPTS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/scripts"
# ASCII Header for the script
# ...
# Print a message
echo -e "${NOTICE_COLOR}AVAILABLE OPTIONS${NO_COLOR}"
echo -e "${NOTICE_COLOR}-----------------${NO_COLOR}"
# Create the menu
while true; do
echo "1. Add new WordPress site"
echo "2. Migrate an existing WordPress site"
echo "3. Exit"
read -rp "Enter your choice: " choice
case $choice in
1)
bash "$SCRIPTS_DIR/deploy_wordpress_site.sh"
exit 0
;;
2)
bash "$SCRIPTS_DIR/migrate_wordpress_site.sh"
exit 0
;;
3)
echo "Exiting the script..."
break
;;
*)
echo "Invalid option $choice"
;;
esac
done