2025-11-02 23:49:54 -08:00
|
|
|
#!/usr/bin/env bash
|
2025-04-01 10:25:46 +02:00
|
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
2025-01-01 13:37:29 +01:00
|
|
|
# Copyright (c) 2021-2025 tteck
|
2025-11-05 14:20:33 +01:00
|
|
|
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
|
2024-12-16 12:42:51 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://openwebui.com/
|
2024-10-22 18:39:54 +02:00
|
|
|
|
|
|
|
|
APP="Open WebUI"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_tags="${var_tags:-ai;interface}"
|
|
|
|
|
var_cpu="${var_cpu:-4}"
|
2025-05-08 21:41:59 +02:00
|
|
|
var_ram="${var_ram:-8192}"
|
|
|
|
|
var_disk="${var_disk:-25}"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_os="${var_os:-debian}"
|
2025-11-05 14:20:33 +01:00
|
|
|
var_version="${var_version:-13}"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_unprivileged="${var_unprivileged:-1}"
|
2024-12-16 12:42:51 +01:00
|
|
|
|
|
|
|
|
header_info "$APP"
|
2024-10-22 18:39:54 +02:00
|
|
|
variables
|
|
|
|
|
color
|
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
|
|
function update_script() {
|
2024-12-16 12:42:51 +01:00
|
|
|
header_info
|
|
|
|
|
check_container_storage
|
|
|
|
|
check_container_resources
|
2025-11-05 14:20:33 +01:00
|
|
|
if [[ ! -d /root/.open-webui ]]; then
|
2024-12-16 12:42:51 +01:00
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2025-03-30 11:43:44 +02:00
|
|
|
|
2025-03-30 17:16:55 +02:00
|
|
|
if [ -x "/usr/bin/ollama" ]; then
|
|
|
|
|
msg_info "Updating Ollama"
|
|
|
|
|
OLLAMA_VERSION=$(ollama -v | awk '{print $NF}')
|
|
|
|
|
RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
|
2025-03-30 11:43:44 +02:00
|
|
|
if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then
|
2025-09-12 06:30:00 -04:00
|
|
|
msg_info "Stopping Service"
|
|
|
|
|
systemctl stop ollama
|
|
|
|
|
msg_ok "Stopped Service"
|
2025-09-21 10:56:31 -06:00
|
|
|
curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz
|
2025-07-01 09:46:07 +02:00
|
|
|
rm -rf /usr/lib/ollama
|
|
|
|
|
rm -rf /usr/bin/ollama
|
2025-03-30 11:43:44 +02:00
|
|
|
tar -C /usr -xzf ollama-linux-amd64.tgz
|
|
|
|
|
rm -rf ollama-linux-amd64.tgz
|
2025-09-12 06:30:00 -04:00
|
|
|
msg_info "Starting Service"
|
|
|
|
|
systemctl start ollama
|
|
|
|
|
msg_info "Started Service"
|
2025-03-30 11:43:44 +02:00
|
|
|
msg_ok "Ollama updated to version $RELEASE"
|
|
|
|
|
else
|
|
|
|
|
msg_ok "Ollama is already up to date."
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2025-11-05 14:20:33 +01:00
|
|
|
msg_info "Restarting Open WebUI to initiate update"
|
|
|
|
|
systemctl restart open-webui
|
2025-10-30 09:24:16 -07:00
|
|
|
msg_ok "Updated successfully!"
|
2024-10-22 18:39:54 +02:00
|
|
|
exit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
start
|
|
|
|
|
build_container
|
|
|
|
|
description
|
|
|
|
|
|
|
|
|
|
msg_ok "Completed Successfully!\n"
|
2024-12-16 12:42:51 +01:00
|
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
|
|
|
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
2025-05-08 21:41:59 +02:00
|
|
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"
|