mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/usr/bin/env bash
 | 
						|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
 | 
						|
# Copyright (c) 2021-2025 community-scripts ORG
 | 
						|
# Author: MickLesk
 | 
						|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
 | 
						|
# Source: https://komo.do
 | 
						|
 | 
						|
APP="Komodo"
 | 
						|
var_tags="${var_tags:-docker}"
 | 
						|
var_cpu="${var_cpu:-2}"
 | 
						|
var_ram="${var_ram:-2048}"
 | 
						|
var_disk="${var_disk:-10}"
 | 
						|
var_os="${var_os:-debian}"
 | 
						|
var_version="${var_version:-12}"
 | 
						|
var_unprivileged="${var_unprivileged:-1}"
 | 
						|
 | 
						|
header_info "$APP"
 | 
						|
variables
 | 
						|
color
 | 
						|
catch_errors
 | 
						|
 | 
						|
function update_script() {
 | 
						|
  header_info
 | 
						|
  check_container_storage
 | 
						|
  check_container_resources
 | 
						|
 | 
						|
  [[ -d /opt/komodo ]] || {
 | 
						|
    msg_error "No ${APP} Installation Found!"
 | 
						|
    exit 1
 | 
						|
  }
 | 
						|
 | 
						|
  msg_info "Updating ${APP}"
 | 
						|
  COMPOSE_FILE=$(find /opt/komodo -maxdepth 1 -type f -name '*.compose.yaml' ! -name 'compose.env' | head -n1)
 | 
						|
  if [[ -z "$COMPOSE_FILE" ]]; then
 | 
						|
    msg_error "No valid compose file found in /opt/komodo!"
 | 
						|
    exit 1
 | 
						|
  fi
 | 
						|
  COMPOSE_BASENAME=$(basename "$COMPOSE_FILE")
 | 
						|
  BACKUP_FILE="/opt/komodo/${COMPOSE_BASENAME}.bak_$(date +%Y%m%d_%H%M%S)"
 | 
						|
  cp "$COMPOSE_FILE" "$BACKUP_FILE" || {
 | 
						|
    msg_error "Failed to create backup of ${COMPOSE_BASENAME}!"
 | 
						|
    exit 1
 | 
						|
  }
 | 
						|
  GITHUB_URL="https://raw.githubusercontent.com/moghtech/komodo/main/compose/${COMPOSE_BASENAME}"
 | 
						|
  if ! curl -fsSL "$GITHUB_URL" -o "$COMPOSE_FILE"; then
 | 
						|
    msg_error "Failed to download ${COMPOSE_BASENAME} from GitHub!"
 | 
						|
    mv "$BACKUP_FILE" "$COMPOSE_FILE"
 | 
						|
    exit 1
 | 
						|
  fi
 | 
						|
  $STD docker compose -p komodo -f "$COMPOSE_FILE" --env-file /opt/komodo/compose.env up -d
 | 
						|
  msg_ok "Updated ${APP}"
 | 
						|
  exit
 | 
						|
}
 | 
						|
 | 
						|
start
 | 
						|
build_container
 | 
						|
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}:9120${CL}"
 |