mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-03-07 12:19:06 +00:00
Update thelounge.sh
This commit is contained in:
parent
dc49ad1133
commit
bc10a3fa17
@ -53,39 +53,35 @@ function default_settings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
if [[ ! -f /usr/lib/systemd/system/thelounge.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
|
RELEASE=$(curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop thelounge
|
||||||
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
if [[ ! -f /usr/lib/systemd/system/thelounge.service ]]; then
|
msg_info "Updating ${APP} to v${RELEASE}"
|
||||||
msg_error "No ${APP} Installation Found!"
|
apt-get install --only-upgrade nodejs &>/dev/null
|
||||||
exit
|
cd /opt
|
||||||
fi
|
wget -q https://github.com/thelounge/thelounge-deb/releases/download/v${RELEASE}/thelounge_${RELEASE}_all.deb
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
dpkg -i ./thelounge_${RELEASE}_all.deb
|
||||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||||
msg_info "Stopping Service"
|
|
||||||
systemctl stop thelounge
|
|
||||||
msg_ok "Stopped Service"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP} to v${RELEASE}"
|
msg_info "Starting Service"
|
||||||
apt-get install --only-upgrade nodejs &>/dev/null
|
systemctl start thelounge
|
||||||
cd /opt
|
msg_ok "Started Service"
|
||||||
wget -q https://github.com/thelounge/thelounge-deb/releases/download/v${RELEASE}/thelounge_${RELEASE}_all.deb
|
|
||||||
dpkg -i ./thelounge_${RELEASE}_all.deb
|
|
||||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Cleaning up"
|
||||||
systemctl start thelounge
|
rm -rf "/opt/thelounge_${RELEASE}_all.deb"
|
||||||
msg_ok "Started Service"
|
msg_ok "Cleaned"
|
||||||
|
msg_ok "Updated Successfully"
|
||||||
msg_info "Cleaning up"
|
else
|
||||||
rm -rf "/opt/thelounge_${RELEASE}_all.deb"
|
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||||
msg_ok "Cleaned"
|
fi
|
||||||
msg_ok "Updated Successfully"
|
exit
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
@ -93,5 +89,5 @@ build_container
|
|||||||
description
|
description
|
||||||
|
|
||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${APP} should be reachable by going to the following URL.
|
echo -e "${APP} Setup should be reachable by going to the following URL.
|
||||||
${BL}http://${IP}:9000${CL} \n"
|
${BL}http://${IP}:9000${CL} \n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user