Update cloudreve.sh
This commit is contained in:
parent
c61351b868
commit
a727d30127
@ -23,14 +23,28 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /var ]]; then
|
|
||||||
|
if [[ ! -d /opt/cloudreve ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating $APP LXC"
|
|
||||||
$STD apt-get update
|
RELEASE=$(curl -fsSL https://api.github.com/repos/cloudreve/cloudreve/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||||
$STD apt-get -y upgrade
|
if [[ "${RELEASE}" != "$(cat ~/.cloudreve 2>/dev/null)" ]] || [[ ! -f ~/.cloudreve ]]; then
|
||||||
msg_ok "Updated $APP LXC"
|
msg_info "Stopping $APP"
|
||||||
|
systemctl stop cloudreve
|
||||||
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "cloudreve" "cloudreve/cloudreve" "prebuild" "latest" "/opt/cloudreve" "*linux_amd64.tar.gz"
|
||||||
|
|
||||||
|
msg_info "Starting $APP"
|
||||||
|
systemctl start cloudreve
|
||||||
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
|
msg_ok "Update Successful"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user