mirror of https://github.com/tteck/Proxmox.git
Compare commits
2 Commits
bb6759aae8
...
71107fedc4
Author | SHA1 | Date |
---|---|---|
Elad Bar | 71107fedc4 | |
Elad Bar | 8335fbd3d5 |
|
@ -57,8 +57,32 @@ function update_script() {
|
||||||
header_info
|
header_info
|
||||||
if [[ ! -f /etc/systemd/system/keycloak.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -f /etc/systemd/system/keycloak.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
|
|
||||||
|
msg_info "Updating packages"
|
||||||
apt-get update &>/dev/null
|
apt-get update &>/dev/null
|
||||||
apt-get -y upgrade &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
|
|
||||||
|
RELEASE=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
|
msg_info "Downloading Keycloak v$RELEASE"
|
||||||
|
cd /opt
|
||||||
|
wget -q https://github.com/keycloak/keycloak/releases/download/$RELEASE/keycloak-$RELEASE.tar.gz
|
||||||
|
$STD tar -xvf keycloak-$RELEASE.tar.gz
|
||||||
|
|
||||||
|
msg_info "Merging configuration files"
|
||||||
|
cp -r keycloak/conf keycloak-$RELEASE
|
||||||
|
cp -r keycloak/providers keycloak-$RELEASE
|
||||||
|
cp -r keycloak/themes keycloak-$RELEASE
|
||||||
|
|
||||||
|
msg_info "Updating Keycloak"
|
||||||
|
mv keycloak keycloak.old
|
||||||
|
mv keycloak-$RELEASE keycloak
|
||||||
|
|
||||||
|
msg_info "Delete temporary installation files"
|
||||||
|
rm keycloak-$RELEASE.tar.gz
|
||||||
|
rm -rf keycloak.old
|
||||||
|
|
||||||
|
msg_info "Restating Keycloak"
|
||||||
|
systemctl restart keycloak
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}
|
||||||
tar -C /tmp -xzf traefik*.tar.gz
|
tar -C /tmp -xzf traefik*.tar.gz
|
||||||
mv /tmp/traefik /usr/bin/
|
mv /tmp/traefik /usr/bin/
|
||||||
rm -rf traefik*.tar.gz
|
rm -rf traefik*.tar.gz
|
||||||
|
systemctl restart traefik.service
|
||||||
msg_ok "Updated $APP LXC"
|
msg_ok "Updated $APP LXC"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
|
Loading…
Reference in New Issue