-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
122 lines (111 loc) · 2.87 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
#!/bin/bash
# Function to check and install required packages for text formatting and colors
function install_dependencies {
echo "Checking for required packages..."
if ! command -v figlet &> /dev/null; then
echo "Installing figlet..."
sudo apt-get install -y figlet
fi
if ! command -v toilet &> /dev/null; then
echo "Installing toilet..."
sudo apt-get install -y toilet
fi
echo "Required packages installed successfully!"
echo
echo "Making all the scripts executable..."
chmod +x etherpad-lite/word_install.sh
chmod +x ethercalc/spreadsheet_install.sh
chmod +x citadel/mail_install.sh
}
# Function to display the colorful heading
function display_heading {
tput setaf 6 # Set color to cyan
toilet -f big "CDN Office Suite" --gay
tput sgr0 # Reset colors
}
# Function to display the menu
function display_menu {
tput setaf 3 # Set color to yellow for description
echo "Welcome to the CDN Office Suite installer."
echo "This script installs the CDN Office Suite. Choose to install all tools or select individual ones."
tput sgr0 # Reset color
echo
echo "1. Install Full CDN Office Suite"
echo "2. Install CDN Word"
echo "3. Install CDN Spreadsheet"
echo "4. Install CDN Email"
echo "5. Update Script"
echo "6. Exit"
}
# Function to install full suite
function install_full_suite {
echo "Installing Full CDN Office Suite..."
install_word
install_spreadsheet
install_email
}
# Function to install Word tool
function install_word {
echo "Installing CDN Word..."
./etherpad-lite/word_install.sh
echo "CDN Word installed successfully!"
echo
}
# Function to install Spreadsheet tool
function install_spreadsheet {
echo "Installing CDN Spreadsheet..."
./ethercalc/spreadsheet_install.sh
echo "CDN Spreadsheet installed successfully!"
echo
}
# Function to install email tool
function install_email {
echo "Installing CDN Email..."
./citadel/mail_install.sh
echo "CDN Email installed successfully!"
echo
}
# Function to update the script
function update_script {
echo "Updating the script..."
git fetch --all
Git reset --hard origin/main
chmod +x etherpad-lite/word_install.sh
chmod +x ethercalc/spreadsheet_install.sh
chmod +x citadel/mail_install.sh
chmod +x install.sh
echo "Script updated successfully!"
}
# Main script logic
install_dependencies
clear # Clear the terminal for better visibility
display_heading
# Main loop to handle user choices
while true; do
display_menu
read -p "Enter your choice (1-6): " choice
case $choice in
1)
install_full_suite
;;
2)
install_word
;;
3)
install_spreadsheet
;;
4)
install_email
;;
5)
update_script
;;
6)
echo "Exiting CDN Office Suite installer. Goodbye!"
exit 0
;;
*)
echo "Invalid option, please select a valid number (1-6)."
;;
esac
done