| sudo dnf install java-11-openjdk -y || { echo "Failed to install Java 11"; exit 1; } | sudo dnf install java-11-openjdk -y || { echo "Failed to install Java 11"; exit 1; } | ||||
| fi | fi | ||||
| # MySQL Installation for CentOS Stream | |||||
| if [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS Stream" ]]; then | |||||
| sudo dnf install mysql-server -y | |||||
| sudo systemctl start mysqld | |||||
| sudo systemctl enable mysqld | |||||
| MYSQL_ROOT_PASSWORD=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}') | |||||
| echo "MySQL root temporary password: $MYSQL_ROOT_PASSWORD" | |||||
| sudo mysql_secure_installation | |||||
| else | |||||
| # If on Ubuntu/Debian, you can use debconf-set-selections | |||||
| sudo debconf-set-selections <<EOF | |||||
| mysql-server mysql-server/lowercase-table-names select Enabled | |||||
| EOF | |||||
| sudo apt install mysql-server -y | |||||
| sudo systemctl start mysql | |||||
| fi | |||||
| git clone $REPOSERVER/$REPOOWNER/bbhverse | git clone $REPOSERVER/$REPOOWNER/bbhverse | ||||
| cd bbhverse | cd bbhverse | ||||
| npm i | npm i | ||||
| # ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'cihsr'; | # ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'cihsr'; | ||||
| # FLUSH PRIVILEGES; | # FLUSH PRIVILEGES; | ||||
| bash elxr/mysql.init.sh | |||||
| bash elxr/i.mysql.sh | |||||
| bash elxr/load.mysql.sh | bash elxr/load.mysql.sh | ||||
| bash elxr/i.sqlexpress.sh | bash elxr/i.sqlexpress.sh | ||||
| bash elxr/load.sqlexpress.sh | bash elxr/load.sqlexpress.sh |
| echo "Updating the system..." | echo "Updating the system..." | ||||
| sudo yum update -y | sudo yum update -y | ||||
| # MySQL Installation for CentOS Stream | |||||
| sudo dnf install mysql-server -y | |||||
| sudo systemctl start mysqld | |||||
| sudo systemctl enable mysqld | |||||
| MYSQL_ROOT_PASSWORD=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}') | |||||
| echo "MySQL root temporary password: $MYSQL_ROOT_PASSWORD" | |||||
| sudo mysql_secure_installation | |||||
| bash elxr/mysql.init.sh | |||||
| # Install the MySQL repository | # Install the MySQL repository | ||||
| echo "Installing MySQL repository..." | |||||
| sudo yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm | |||||
| # Enable the MySQL repository | |||||
| echo "Enabling MySQL repository..." | |||||
| sudo yum-config-manager --enable mysql80-community | |||||
| # Install MySQL server | |||||
| echo "Installing MySQL server..." | |||||
| sudo yum install -y mysql-server | |||||
| # Start MySQL service | |||||
| echo "Starting MySQL service..." | |||||
| sudo systemctl start mysqld | |||||
| # Enable MySQL to start on boot | |||||
| echo "Enabling MySQL to start on boot..." | |||||
| sudo systemctl enable mysqld | |||||
| # Get the temporary MySQL root password | |||||
| TEMP_PASS=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}') | |||||
| echo "Temporary MySQL root password: $TEMP_PASS" | |||||
| # Secure MySQL installation (you can modify the commands for automation if desired) | |||||
| echo "Securing MySQL installation..." | |||||
| sudo mysql_secure_installation <<EOF | |||||
| y | |||||
| $TEMP_PASS | |||||
| newpassword | |||||
| newpassword | |||||
| y | |||||
| y | |||||
| y | |||||
| y | |||||
| EOF | |||||
| # Output MySQL status | |||||
| echo "MySQL installation completed successfully." | |||||
| # You can log into MySQL by running: | |||||
| echo "You can log into MySQL with: mysql -u root -p" | |||||
| # echo "Installing MySQL repository..." | |||||
| # sudo yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm | |||||
| # # Enable the MySQL repository | |||||
| # echo "Enabling MySQL repository..." | |||||
| # sudo yum-config-manager --enable mysql80-community | |||||
| # # Install MySQL server | |||||
| # echo "Installing MySQL server..." | |||||
| # sudo yum install -y mysql-server | |||||
| # # Start MySQL service | |||||
| # echo "Starting MySQL service..." | |||||
| # sudo systemctl start mysqld | |||||
| # # Enable MySQL to start on boot | |||||
| # echo "Enabling MySQL to start on boot..." | |||||
| # sudo systemctl enable mysqld | |||||
| # # Get the temporary MySQL root password | |||||
| # TEMP_PASS=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}') | |||||
| # echo "Temporary MySQL root password: $TEMP_PASS" | |||||
| # # Secure MySQL installation (you can modify the commands for automation if desired) | |||||
| # echo "Securing MySQL installation..." | |||||
| # sudo mysql_secure_installation <<EOF | |||||
| # y | |||||
| # $TEMP_PASS | |||||
| # newpassword | |||||
| # newpassword | |||||
| # y | |||||
| # y | |||||
| # y | |||||
| # y | |||||
| # EOF | |||||
| # Determine the group to add the user to based on the OS | |||||
| if [ -f /etc/os-release ]; then | |||||
| . /etc/os-release | |||||
| OS_NAME=$NAME | |||||
| fi | |||||
| # MySQL Installation for CentOS Stream | |||||
| if [[ "$OS_NAME" == "CentOS Linux" ]] || [[ "$OS_NAME" == "CentOS Stream" ]]; then | |||||
| bash elxr/i.mysql.centos.sh | |||||
| else | |||||
| # If on Ubuntu/Debian, you can use debconf-set-selections | |||||
| sudo debconf-set-selections <<EOF | |||||
| mysql-server mysql-server/lowercase-table-names select Enabled | |||||
| EOF | |||||
| sudo apt install mysql-server -y | |||||
| sudo systemctl start mysql | |||||
| fi | |||||
| # Output MySQL status | |||||
| echo "MySQL installation completed successfully." | |||||
| # You can log into MySQL by running: | |||||
| echo "You can log into MySQL with: mysql -u root -p" | |||||
| source ~/.bashrc | source ~/.bashrc | ||||
| # Verify installation | # Verify installation | ||||
| sqlcmd --version | |||||
| sqlcmd --? | |||||
| } | } | ||||
| # Function to install SQL Server on CentOS | # Function to install SQL Server on CentOS |
| , getbash : ()=>{ return "sh" } | , getbash : ()=>{ return "sh" } | ||||
| , createJuntionOrLink : (dirOrFile, target, opts)=>{ | , createJuntionOrLink : (dirOrFile, target, opts)=>{ | ||||
| return nodeShellExec('ln', ['-sf', target, dirOrFile], opts).catch((e) => { | |||||
| var promises = [] | |||||
| promises.push( | |||||
| nodeShellExec('rm', [dirOrFile], opts).catch((e) => { | |||||
| console.error(util.inspect(e)) | |||||
| fs.writeFileSync( `${this.tempRunDir()}\\run.log`, ', ' + JSON.stringify({ e }), {'flag':'a+'} ) | |||||
| }) | |||||
| ) | |||||
| promises.push(nodeShellExec('ln', ['-s', target, dirOrFile], opts).catch((e) => { | |||||
| console.error(util.inspect(e)) | console.error(util.inspect(e)) | ||||
| fs.writeFileSync( `${this.tempRunDir()}\\run.log`, ', ' + JSON.stringify({ e }), {'flag':'a+'} ) | fs.writeFileSync( `${this.tempRunDir()}\\run.log`, ', ' + JSON.stringify({ e }), {'flag':'a+'} ) | ||||
| }) | }) | ||||
| ) | |||||
| return any(promises) | |||||
| } | } | ||||
| , removeJuncionOrLink : ( junctionOrLink )=>{ | , removeJuncionOrLink : ( junctionOrLink )=>{ |
| #!/bin/bash | #!/bin/bash | ||||
| # Prompt for MySQL root password securely | # Prompt for MySQL root password securely | ||||
| read -sp "Enter MySQL root password: " MYSQL_PASSWORD | |||||
| read -sp "Enter MSSQL root password: " MSSQL_PASSWORD | |||||
| echo # Newline after password input | echo # Newline after password input | ||||
| # Prompt for the database name (default: elixir) | # Prompt for the database name (default: elixir) |