-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmig-installer.sh
99 lines (79 loc) · 2.26 KB
/
mig-installer.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
#!/bin/bash
#mig-installer.sh #Bootstrap to GIT REPO
TEXTRESET=$(tput sgr0)
RED=$(tput setaf 1)
YELLOW=$(tput setaf 3)
GREEN=$(tput setaf 2)
USER=$(whoami)
MAJOROS=$(cat /etc/redhat-release | grep -Eo "[0-9]" | sed '$d')
#Checking for user permissions
if [ "$USER" = "root" ]; then
echo " "
else
echo ${RED}"This program must be run as root ${TEXTRESET}"
echo "Exiting"
sleep 2
exit
fi
#Checking for version Information
#if [ "$MAJOROS" = "9" ]; then
# echo " "
#else
# echo ${RED}"Sorry, but this installer only works on Rocky 9.X ${TEXTRESET}"
# echo "Please upgrade to ${GREEN}Rocky 9.x${TEXTRESET}"
# echo "Exiting the installer..."
# sleep 2
# exit
#fi
cat <<EOF
${GREEN}
***************************************
Please wait while we gather some files
***************************************
${TEXTRESET}
${YELLOW}Installing wget and git${TEXTRESET}
EOF
sleep 1
dnf -y install wget git dialog
cat <<EOF
${YELLOW}
*****************************
Retrieving Files from GitHub
*****************************
${TEXTRESET}
EOF
sleep 1
#Clone MIG
mkdir /root/MIGInstaller
git clone https://github.com/fumatchu/CMDS.git /root/MIGInstaller
chmod 700 /root/MIGInstaller/MIG*
clear
#cat <<EOF
# *********************************************
# This script was created for ${GREEN}Rocky 9.x${TEXTRESET}
# This will install
# 1. CMDS with C9300 Migration capabilities
# 2. CMDS with Catalyst Wireless Monitoring (setup) capabilities
# What this script does:
# 1. Apply appropriate SELinux context and Firewall rules
# 2. Install the REPO(s) needed and dependencies needed
# 3. Configure the system as needed, based on your answers
# 4. Provides an (optional) Name Server
# 5. Provides an (optional) DHCP Server
# 6. Provides a tftp collection server
# 7. Provides all the scripts to migrate the c9300's
# 8. Provides all the scripts to setup Catalyst Monitoring for c9800s
#*********************************************
#EOF
#read -p "Press Enter to Continue"
items=(1 "Deploy CMDS for Rocky 8 - STABLE"
)
while choice=$(dialog --title "$TITLE" \
--backtitle "Server Installer" \
--menu "Please select the install type" 15 65 3 "${items[@]}" \
2>&1 >/dev/tty); do
case $choice in
1) /root/MIGInstaller/MIGInstall8.sh ;;
esac
done
clear # clear after user pressed Cancel