mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Refactor (#6305)
This commit is contained in:
		
							
								
								
									
										19
									
								
								ct/argus.sh
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								ct/argus.sh
									
									
									
									
									
								
							@@ -23,20 +23,23 @@ function update_script() {
 | 
				
			|||||||
  header_info
 | 
					  header_info
 | 
				
			||||||
  check_container_storage
 | 
					  check_container_storage
 | 
				
			||||||
  check_container_resources
 | 
					  check_container_resources
 | 
				
			||||||
 | 
					 | 
				
			||||||
  if [[ ! -d /opt/argus ]]; then
 | 
					  if [[ ! -d /opt/argus ]]; then
 | 
				
			||||||
    msg_error "No ${APP} Installation Found!"
 | 
					    msg_error "No ${APP} Installation Found!"
 | 
				
			||||||
    exit
 | 
					    exit
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//')
 | 
					  RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//')
 | 
				
			||||||
  if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
 | 
					  if [[ "${RELEASE}" != "$(cat ~/.Argus 2>/dev/null)" ]] || [[ ! -f ~/.Argus ]]; then
 | 
				
			||||||
    msg_info "Updating $APP to ${RELEASE}"
 | 
					    msg_info "Stopping service"
 | 
				
			||||||
    rm -f /opt/argus/Argus
 | 
					    systemctl stop argus
 | 
				
			||||||
    curl -fsSL "https://github.com/release-argus/Argus/releases/download/${RELEASE}/Argus-${RELEASE}.linux-amd64" -o /opt/argus/Argus
 | 
					    msg_ok "Service stopped"
 | 
				
			||||||
    chmod +x /opt/argus/Argus
 | 
					
 | 
				
			||||||
    systemctl restart argus
 | 
					    fetch_and_deploy_gh_release "Argus" "release-argus/Argus" "singlefile" "latest" "/opt/argus" "Argus*linux-amd64"
 | 
				
			||||||
    echo "${RELEASE}" >/opt/${APP}_version.txt
 | 
					
 | 
				
			||||||
 | 
					    msg_info "Starting service"
 | 
				
			||||||
 | 
					    systemctl start argus
 | 
				
			||||||
 | 
					    msg_ok "Service started"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    msg_ok "Updated ${APP} to ${RELEASE}"
 | 
					    msg_ok "Updated ${APP} to ${RELEASE}"
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    msg_ok "${APP} is already up to date (${RELEASE})"
 | 
					    msg_ok "${APP} is already up to date (${RELEASE})"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,17 +13,7 @@ setting_up_container
 | 
				
			|||||||
network_check
 | 
					network_check
 | 
				
			||||||
update_os
 | 
					update_os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Installing Dependencies"
 | 
					fetch_and_deploy_gh_release "Argus" "release-argus/Argus" "singlefile" "latest" "/opt/argus" "Argus*linux-amd64"
 | 
				
			||||||
$STD apt-get install -y \
 | 
					 | 
				
			||||||
  jq
 | 
					 | 
				
			||||||
msg_ok "Installed Dependencies"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
msg_info "Setup Argus"
 | 
					 | 
				
			||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//')
 | 
					 | 
				
			||||||
mkdir -p /opt/argus
 | 
					 | 
				
			||||||
curl -fsSL "https://github.com/release-argus/Argus/releases/download/${RELEASE}/Argus-${RELEASE}.linux-amd64" -o /opt/argus/Argus
 | 
					 | 
				
			||||||
chmod +x /opt/argus/Argus
 | 
					 | 
				
			||||||
msg_ok "Setup Argus"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Setup Argus Config"
 | 
					msg_info "Setup Argus Config"
 | 
				
			||||||
cat <<EOF >/opt/argus/config.yml
 | 
					cat <<EOF >/opt/argus/config.yml
 | 
				
			||||||
@@ -71,7 +61,6 @@ service:
 | 
				
			|||||||
      icon_link_to: https://helper-scripts.com/
 | 
					      icon_link_to: https://helper-scripts.com/
 | 
				
			||||||
      web_url: https://github.com/community-scripts/ProxmoxVE/releases
 | 
					      web_url: https://github.com/community-scripts/ProxmoxVE/releases
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
 | 
					 | 
				
			||||||
msg_ok "Setup Config"
 | 
					msg_ok "Setup Config"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Creating Service"
 | 
					msg_info "Creating Service"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user