mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-03 09:52:50 +00:00
Refactor: Kavita + Updated tools.func (no-same-owner) (#8594)
This commit is contained in:
41
ct/kavita.sh
41
ct/kavita.sh
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
@@ -20,23 +20,28 @@ color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/Kavita ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating $APP LXC"
|
||||
systemctl stop kavita
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Kareadita/Kavita/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
$STD tar -xvzf <(curl -fsSL https://github.com/Kareadita/Kavita/releases/download/$RELEASE/kavita-linux-x64.tar.gz) --no-same-owner
|
||||
rm -rf Kavita/config
|
||||
cp -r Kavita/* /opt/Kavita
|
||||
rm -rf Kavita
|
||||
systemctl start kavita
|
||||
msg_ok "Updated $APP LXC"
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/Kavita ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "kavita" "Kareadita/Kavita"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop kavita
|
||||
msg_ok "Service Stopped"
|
||||
|
||||
fetch_and_deploy_gh_release "kavita" "Kareadita/Kavita" "prebuild" "latest" "/opt/Kavita" "kavita-linux-x64.tar.gz"
|
||||
chmod +x /opt/Kavita/Kavita && chown root:root /opt/Kavita/Kavita
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start kavita
|
||||
msg_ok "Service Started"
|
||||
msg_ok "Update Successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
@@ -46,4 +51,4 @@ 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 URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"
|
||||
|
||||
Reference in New Issue
Block a user