Refactor (#6305)
This commit is contained in:
parent
bd9c778922
commit
d4c59caf12
19
ct/argus.sh
19
ct/argus.sh
@ -23,20 +23,23 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/argus ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
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
|
||||
msg_info "Updating $APP to ${RELEASE}"
|
||||
rm -f /opt/argus/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
|
||||
systemctl restart argus
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
if [[ "${RELEASE}" != "$(cat ~/.Argus 2>/dev/null)" ]] || [[ ! -f ~/.Argus ]]; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop argus
|
||||
msg_ok "Service stopped"
|
||||
|
||||
fetch_and_deploy_gh_release "Argus" "release-argus/Argus" "singlefile" "latest" "/opt/argus" "Argus*linux-amd64"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start argus
|
||||
msg_ok "Service started"
|
||||
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
else
|
||||
msg_ok "${APP} is already up to date (${RELEASE})"
|
||||
|
@ -13,17 +13,7 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$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"
|
||||
fetch_and_deploy_gh_release "Argus" "release-argus/Argus" "singlefile" "latest" "/opt/argus" "Argus*linux-amd64"
|
||||
|
||||
msg_info "Setup Argus Config"
|
||||
cat <<EOF >/opt/argus/config.yml
|
||||
@ -71,7 +61,6 @@ service:
|
||||
icon_link_to: https://helper-scripts.com/
|
||||
web_url: https://github.com/community-scripts/ProxmoxVE/releases
|
||||
EOF
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Setup Config"
|
||||
|
||||
msg_info "Creating Service"
|
||||
|
Loading…
x
Reference in New Issue
Block a user