Add Alpine-TeamSpeak
This commit is contained in:
parent
4b243158bd
commit
518c66fc2b
57
ct/alpine-teamspeak-server.sh
Normal file
57
ct/alpine-teamspeak-server.sh
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||||
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
|
# Author: Slaviša Arežina (tremor021)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/TwiN/gatus
|
||||||
|
|
||||||
|
APP="Alpine-TeamSpeak-Server"
|
||||||
|
var_tags="${var_tags:-alpine;communication}"
|
||||||
|
var_cpu="${var_cpu:-1}"
|
||||||
|
var_ram="${var_ram:-256}"
|
||||||
|
var_disk="${var_disk:-2}"
|
||||||
|
var_os="${var_os:-alpine}"
|
||||||
|
var_version="${var_version:-3.22}"
|
||||||
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
|
header_info "$APP"
|
||||||
|
variables
|
||||||
|
color
|
||||||
|
catch_errors
|
||||||
|
|
||||||
|
function update_script() {
|
||||||
|
header_info
|
||||||
|
|
||||||
|
if [[ ! -d /opt/teamspeak-server ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://teamspeak.com/en/downloads/#server | sed -n 's/.*teamspeak3-server_linux_amd64-\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p' | head -1)
|
||||||
|
if [ "${RELEASE}" != "$(cat ~/.teamspeak-server)" ] || [ ! -f ~/.teamspeak-server ]; then
|
||||||
|
msg_info "Updating ${APP} LXC"
|
||||||
|
$STD apk -U upgrade
|
||||||
|
$STD service teamspeak stop
|
||||||
|
curl -fsSL "https://files.teamspeak-services.com/releases/server/${RELEASE}/teamspeak3-server_linux_amd64-${RELEASE}.tar.bz2" -o ts3server.tar.bz2
|
||||||
|
tar -xf ./ts3server.tar.bz2
|
||||||
|
cp -ru teamspeak3-server_linux_amd64/* /opt/teamspeak-server/
|
||||||
|
rm -f ~/ts3server.tar.bz*
|
||||||
|
rm -rf teamspeak3-server_linux_amd64
|
||||||
|
echo "${RELEASE}" >~/.teamspeak-server
|
||||||
|
$STD service teamspeak start
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
start
|
||||||
|
build_container
|
||||||
|
description
|
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n"
|
||||||
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
|
echo -e "${INFO}${YW} Access it using the following IP:${CL}"
|
||||||
|
echo -e "${TAB}${GATEWAY}${BGN}${IP}:9987${CL}"
|
69
install/alpine-teamspeak-server-install.sh
Normal file
69
install/alpine-teamspeak-server-install.sh
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
|
# Author: Slaviša Arežina (tremor021)
|
||||||
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
# Source: https://github.com/TwiN/gatus
|
||||||
|
|
||||||
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||||
|
color
|
||||||
|
verb_ip6
|
||||||
|
catch_errors
|
||||||
|
setting_up_container
|
||||||
|
network_check
|
||||||
|
update_os
|
||||||
|
|
||||||
|
msg_info "Installing dependencies"
|
||||||
|
$STD apk add --no-cache \
|
||||||
|
ca-certificates \
|
||||||
|
libstdc++ \
|
||||||
|
libc6-compat
|
||||||
|
msg_ok "Installed dependencies"
|
||||||
|
|
||||||
|
RELEASE=$(curl -fsSL https://teamspeak.com/en/downloads/#server | sed -n 's/.*teamspeak3-server_linux_amd64-\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p' | head -1)
|
||||||
|
|
||||||
|
msg_info "Installing Teamspeak Server v${RELEASE}"
|
||||||
|
mkdir -p /opt/teamspeak-server
|
||||||
|
cd /opt/teamspeak-server
|
||||||
|
curl -fsSL "https://files.teamspeak-services.com/releases/server/${RELEASE}/teamspeak3-server_linux_amd64-${RELEASE}.tar.bz2" -o ts3server.tar.bz2
|
||||||
|
tar xf ts3server.tar.bz2 --strip-components=1
|
||||||
|
mkdir -p logs data lib
|
||||||
|
mv *.so lib
|
||||||
|
touch data/ts3server.sqlitedb data/query_ip_blacklist.txt data/query_ip_whitelist.txt .ts3server_license_accepted
|
||||||
|
echo "${RELEASE}" >~/.teamspeak-server
|
||||||
|
msg_ok "Installed TeamSpeak Server v${RELEASE}"
|
||||||
|
|
||||||
|
msg_info "Enabling TeamSpeak Server Service"
|
||||||
|
cat <<EOF >/etc/init.d/teamspeak
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
name="TeamSpeak Server"
|
||||||
|
description="TeamSpeak 3 Server"
|
||||||
|
command="/opt/teamspeak-server/ts3server_startscript.sh"
|
||||||
|
command_args="start"
|
||||||
|
output_log="/var/log/teamspeak.out.log"
|
||||||
|
error_log="/var/log/teamspeak.err.log"
|
||||||
|
command_background=true
|
||||||
|
pidfile="/run/teamspeak-server.pid"
|
||||||
|
directory="/opt/teamspeak-server"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
use dns
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
chmod +x /etc/init.d/teamspeak
|
||||||
|
$STD rc-update add teamspeak default
|
||||||
|
msg_ok "Enabled TeamSpeak Server Service"
|
||||||
|
|
||||||
|
msg_info "Starting TeamSpeak Server"
|
||||||
|
$STD service gatus start
|
||||||
|
msg_ok "Started TeamSpeak Server"
|
||||||
|
|
||||||
|
motd_ssh
|
||||||
|
customize
|
||||||
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
rm -r ts3server.tar.bz* LICENSE* CHANGELOG doc serverquerydocs tsdns redist
|
||||||
|
$STD apk cache clean
|
||||||
|
msg_ok "Cleaned"
|
Loading…
x
Reference in New Issue
Block a user