Commit 308a764b authored by Kroese's avatar Kroese Committed by GitHub
Browse files

fix: Prepare agent for removal

fix: Prepare for removal
parents 3c342a05 5ad5f8a8
Loading
Loading
Loading
Loading
+5 −26
Original line number Diff line number Diff line
#!/usr/bin/env bash
set -u

VERSION="8"
VERSION="9"
HEADER="VirtualDSM Agent"

# Functions
@@ -45,8 +45,12 @@ function downloadUpdate {

  [[ "$remote_size" == "" || "$remote_size" == "0" ]] && return

  remote_size=$(($remote_size+0))
  ((remote_size<100)) && return

  SCRIPT=$(readlink -f "${BASH_SOURCE[0]}")
  local_size=$(stat -c%s "$SCRIPT")
  local_size=$(($local_size+0))

  [[ remote_size -eq local_size ]] && return

@@ -126,31 +130,6 @@ else

fi

delay=500
elapsed=$((($(date +%s%N) - ts)/1000000))

if [[ delay -gt elapsed ]]; then
  difference=$((delay-elapsed))
  float=$(echo | awk -v diff="${difference}" '{print diff * 0.001}')
  sleep "$float"
fi

# Display message in docker log output

IP=$(ip address show dev eth0 | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)

if [[ "$IP" == "20.20"* ]]; then
  MSG="port 5000"
else
  MSG="http://${IP}:5000"
fi

echo ""
info "--------------------------------------------------------"
info " You can now login to DSM at ${MSG}"
info "--------------------------------------------------------"
echo ""

# Wait for NMI interrupt as a shutdown signal

while true; do