Unverified Commit 9126bc68 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Check for updates

parent 74d3595c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -65,6 +65,17 @@ else
  # TODO: Auto-update agent
  echo "Checking for updates.." > /dev/ttyS0

  rm -f /tmp/agent.sh

  if curl -s -k -m 5 -o /tmp/agent.sh https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh; then
    if [ -f /tmp/agent.sh ]; then
      line=$(read -r FIRSTLINE < /tmp/agent.sh)
      if [ "$line" == "#!/usr/bin/env bash" ]; then
         echo "Update found.." > /dev/ttyS0
      fi
    fi
  fi

  sleep 5

fi