aboutsummaryrefslogtreecommitdiff
path: root/erp-playbook/local_scripts/check-for-changes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'erp-playbook/local_scripts/check-for-changes.sh')
-rw-r--r--erp-playbook/local_scripts/check-for-changes.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/erp-playbook/local_scripts/check-for-changes.sh b/erp-playbook/local_scripts/check-for-changes.sh
new file mode 100644
index 0000000..5379148
--- /dev/null
+++ b/erp-playbook/local_scripts/check-for-changes.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+URLs=$(cat <<EOF
+ http://repo.linaro.org/debian/erp-17.08-stable/dists/jessie/main/binary-arm64/Packages.bz2
+ http://repo.linaro.org/debian/erp-17.08-staging/dists/jessie/main/binary-arm64/Packages.bz2
+ http://repo.linaro.org/debian/erp-17.08-staging/dists/jessie/main/debian-installer/binary-arm64/Packages.gz
+EOF
+)
+
+RESULT=""
+for url in $URLs; do
+
+ LAST_CHANGE="$(curl --silent -I ${url} | grep ^Last-Modified | sed 's/Last-Modified: //')"
+ # Convert to a sortable datetime
+ LAST_CHANGE=$(date -d "${LAST_CHANGE}" --iso-8601=seconds --utc)
+
+ if [ -n "${RESULT}" ]; then
+ RESULT="${RESULT}\n"
+ fi
+ RESULT="${RESULT}${LAST_CHANGE}"
+
+done
+
+#echo "${RESULT}"
+#echo ""
+echo "Last Change: $(echo "${RESULT}" | sort -n | tail -1)"
+