ProxmoxVE/install/sqlserver2022-install.sh
CanbiZ 223eecdd8e
Some checks are pending
Auto Update .app-headers / update-app-headers (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Frontend CI/CD / build (push) Waiting to run
Frontend CI/CD / deploy (push) Blocked by required conditions
Update sqlserver2022-install.sh
2025-01-21 21:08:48 +01:00

57 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Kristian Skov
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
curl \
mc \
sudo \
gpg \
coreutils
msg_ok "Installed Dependencies"
msg_info "Installing SQL Server 2022"
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc
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
/opt/mssql/bin/mssql-conf setup
msg_ok "Installed SQL Server 2022"
msg_info "Installing SQL Server Tools"
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 \
unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
msg_ok "Installed SQL Server Tools"
msg_info "Start Service"
systemctl enable -q --now mssql-server
msg_ok "Service started"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"