Update cc-reinstall.sh

This commit is contained in:
2023-10-17 16:31:44 -05:00
parent 10ef8c3522
commit 3b4af9fba9

View File

@@ -54,65 +54,86 @@ read -n 1 -p "Would you like to now re-install Cluster Control (Y/n)?" choice
case "$choice" in
[Nn]) echo ''; exit 0;;
* )
echo -e "Server 1: Pri MySQL & PostgreSQL\nServer 2: LAN & WAN MySQL"
read -n 1 -p "Select which server (1/2)? " serverchoice
case "${serverchoice}" in
[Nn]) echo ''; exit 0;;
* )
./install-cc -1
./install-cc -1
/opt/copycerts.sh
# apt install -y mailutils xtrabackup
apt install -y mailutils
/opt/copycerts.sh
# apt install -y mailutils xtrabackup
apt install -y mailutils
echo
echo
read -p "Enter a password to set for the Admin account in MySQL: " pwd
echo
echo "Enter the root MySQL password:"
mysql -u root -p -e "CREATE USER 'admin'@'%' IDENTIFIED BY '${pwd}';GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;"
echo
echo
read -p "Enter a new password for the MySQL Admin account in MySQL: " pwd
echo
echo "Enter the root password for creating the admin account:"
mysql -u root -p -e "CREATE USER 'admin'@'%' IDENTIFIED BY '${pwd}';GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;"
read -n 1 -p "Login at https://mysql.scity.us and setup the admin user, verify it brings up the deploy prompt. Once complete then press ENTER" choice
echo
echo
echo "Importing Previous Database Clusters"
if [ "${serverchoice}" == "1" ]; then
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="10.10.1.51;10.10.1.52;10.2.1.51" \
--vendor=mariadb \
--provider-version=10.4 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-MySQL-Galera" \
--wait
/usr/bin/s9s cluster --register \
--cluster-type=postgresql \
--nodes="10.10.0.211;10.10.0.212" \
--vendor=mariadb \
--provider-version=13 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="IDS-Headscale-PostgreSQL" \
--wait
elif [ "${serverchoice}" == "2" ]; then
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="100.100.55.2;100.100.55.3;100.100.55.4" \
--vendor=mariadb \
--provider-version=10.6 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-WAN-DNS-MySQL-Galera" \
--wait
read -n 1 -p "Login at https://mysql.scity.us and setup the admin user, verify it brings up the deploy prompt. Once complete then press ENTER" choice
echo
echo
echo "Importing Previous Database Clusters"
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="10.10.1.51;10.10.1.52" \
--vendor=mariadb \
--provider-version=10.4 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-MySQL-Galera" \
--wait
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="100.100.55.2;100.100.55.3;100.100.55.4" \
--vendor=mariadb \
--provider-version=10.6 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-WAN-DNS-MySQL-Galera" \
--wait
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="100.100.10.1,100.100.10.2,100.100.10.3" \
--vendor=mariadb \
--provider-version=10.6 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-LAN-DNS-MySQL-Galera" \
--wait
/usr/bin/s9s cluster --register \
--cluster-type=galera \
--nodes="100.100.10.1;100.100.10.2;100.100.10.3" \
--vendor=mariadb \
--provider-version=10.6 \
--db-admin="root" \
--db-admin-passwd='Dc$@54115' \
--os-user=root \
--os-key-file=/root/.ssh/id_rsa \
--cluster-name="iDS-LAN-DNS-MySQL-Galera" \
--wait
fi
# bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-postfix.sh)
echo
echo "Install Completed"
# bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-postfix.sh)
echo
echo "Install Completed"
;;
;;
esac