From 61cdfb971cf168d4857a4b2dc756bc30f3643f3c Mon Sep 17 00:00:00 2001 From: Johan Date: Mon, 19 Dec 2022 07:30:49 +0100 Subject: [PATCH] Add MySQL bash installation script --- BashScripts/README.md | 18 ++++++++++++++++++ BashScripts/install-mysql.sh | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 BashScripts/install-mysql.sh diff --git a/BashScripts/README.md b/BashScripts/README.md index cb8bec3..6d9ebe5 100644 --- a/BashScripts/README.md +++ b/BashScripts/README.md @@ -6,3 +6,21 @@ sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-apache.sh)" ``` +## Install MySQL + +```bash +sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-mysql.sh)" +``` + +## Install Bind + +```bash +sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-bind.sh)" +``` + +## Install Samba Active Directory Domain Controller + +```bash +sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-dc.sh)" +``` + diff --git a/BashScripts/install-mysql.sh b/BashScripts/install-mysql.sh new file mode 100644 index 0000000..e703ff5 --- /dev/null +++ b/BashScripts/install-mysql.sh @@ -0,0 +1,15 @@ +# Install using: sudo su -c "bash <(wget -qO- /url/to/install-bind.sh)" + +REALUSER=$(logname) + +apt update 2>>install.log + +if systemctl status mysql.service | grep -q 'Unit mysql.service could not be found'; then + echo "Installing MySQL..." + apt apt install mysql-server -y 2>>install.log && + systemctl start mysql.service 2>>install.log +fi + +systemctl status mysql.service + +echo 'Installation complete' \ No newline at end of file