51 lines
1.3 KiB
Bash
51 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
|
# Copyright (c) 2021-2025 community-scripts ORG
|
|
# Author: MickLesk (Canbiz)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
APP="Mattermost"
|
|
var_disk="${var_disk:-10}"
|
|
var_cpu="${var_cpu:-2}"
|
|
var_ram="${var_ram:-2048}"
|
|
var_os="${var_os:-debian}"
|
|
var_version="${var_version:-12}"
|
|
variables
|
|
color
|
|
catch_errors
|
|
|
|
function update_script() {
|
|
header_info
|
|
if [[ ! -d /opt/mattermost ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
|
RELEASE=$(curl -s https://api.github.com/repos/xxxx/xxxx/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
|
msg_info "Stopping App"
|
|
systemctl stop xxxx
|
|
msg_ok "App Stopped"
|
|
|
|
msg_info "Updating App"
|
|
#
|
|
msg_ok "Updated App"
|
|
|
|
msg_info "Starting App"
|
|
systemctl start App
|
|
msg_ok "Started App"
|
|
|
|
msg_info "Cleaning Up"
|
|
#rm -rf
|
|
msg_ok "Cleaned"
|
|
msg_ok "Updated Successfully"
|
|
else
|
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
fi
|
|
exit
|
|
}
|
|
|
|
start
|
|
build_container
|
|
description
|
|
|
|
msg_ok "Completed Successfully!\n"
|
|
echo -e "${APP} Setup should be reachable by going to the following URL.
|
|
${BL}http://${IP}:8086${CL} \n"
|