mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-18 00:17:43 +01:00
Replace the final '| head -1' in both install and ct scripts with 'awk 'NR==1'' to pick the first matching Teamspeak release line. In the ct script the previous temporary toggling of pipefail was also removed, simplifying the command. This improves compatibility and reduces reliance on an extra utility in minimal environments.
58 lines
1.9 KiB
Bash
58 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: tremor021 (Slaviša Arežina)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://teamspeak.com/en/
|
|
|
|
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.23}"
|
|
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
|
|
fi
|
|
|
|
RELEASE=$(curl -fsSL https://teamspeak.com/en/downloads/#server | sed -n 's/.*teamspeak3-server_linux_amd64-\([0-9.]*[0-9]\).*/\1/p' | awk 'NR==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}"
|