From c5df1bbcea64c390465f3cd9071127cbf9051041 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:25:39 +0100 Subject: [PATCH] Fix: SQL Server 2022 Install (#1669) * Fix: SQL Server 2022 Install * Update sqlserver2022.json --- install/sqlserver2022-install.sh | 25 ++++++++++++------------- json/sqlserver2022.json | 4 ++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/install/sqlserver2022-install.sh b/install/sqlserver2022-install.sh index 19afa300..440e3c3f 100644 --- a/install/sqlserver2022-install.sh +++ b/install/sqlserver2022-install.sh @@ -23,25 +23,17 @@ $STD apt install -y \ msg_ok "Installed Dependencies" msg_info "Get SQL Server 2022 Repository" -mkdir -p /etc/apt/keyrings -curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/keyrings/microsoft-prod.gpg -echo "deb [signed-by=/etc/apt/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list main" >/etc/apt/sources.list.d/mssql-server-2022.list +$STD curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg +$STD curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc +$STD curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server-2022.list $STD apt-get clean * $STD apt-get update -y $STD apt-get install -y mssql-server msg_ok "Get SQL Server 2022 Repository" -read -r -p "Do you want to run the SQL server setup now? (Later is also possible) " prompt -if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - /opt/mssql/bin/mssql-conf setup -else - msg_ok "Skipping SQL Server setup. You can run it later with '/opt/mssql/bin/mssql-conf setup'." -fi - msg_info "Installing SQL Server Tools" -curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/keyrings/microsoft-prod.gpg -echo "deb [signed-by=/etc/apt/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/config/ubuntu/22.04/prod.list main" \ - > /etc/apt/sources.list.d/mssql-release.list +curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc +curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list $STD apt-get update $STD apt-get install -y \ mssql-tools18 \ @@ -50,6 +42,13 @@ echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc msg_ok "Installed SQL Server Tools" +read -r -p "Do you want to run the SQL server setup now? (Later is also possible) " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + /opt/mssql/bin/mssql-conf setup +else + msg_ok "Skipping SQL Server setup. You can run it later with '/opt/mssql/bin/mssql-conf setup'." +fi + msg_info "Start Service" systemctl enable -q --now mssql-server msg_ok "Service started" diff --git a/json/sqlserver2022.json b/json/sqlserver2022.json index 08198556..818b88c4 100644 --- a/json/sqlserver2022.json +++ b/json/sqlserver2022.json @@ -31,6 +31,10 @@ "password":null }, "notes":[ + { + "text":"if you not choose the install setup, execute: `/opt/mssql/bin/mssql-conf setup` in LXC shell.", + "type":"info" + }, { "text":"You can setup the admin account 'SA' during installation", "type":"info"