updated the repo to be in sync with the automation on the cord uber repo
Change-Id: Id8619f662719d73a2ca80cf0cca7f1665fbd267a
diff --git a/utils/enable-remote-docker-registry b/utils/enable-remote-docker-registry
new file mode 100755
index 0000000..9492187
--- /dev/null
+++ b/utils/enable-remote-docker-registry
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+PROG=$(basename $0)
+
+HELP=$(echo "$*" | grep "\-h" | wc -w)
+
+if [ $HELP -ne 0 ]; then
+ echo "usage: $PROG <remote-registry>..."
+ exit 1
+fi
+
+LINE="DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\""
+
+OUT=$(tempfile)
+cat /etc/default/docker >> $OUT
+CHANGED=0
+while [ $# -gt 0 ]; do
+ FOUND=$(grep "$LINE" /etc/default/docker | wc -l)
+ if [ $FOUND -eq 0 ]; then
+ echo "DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" >> $OUT
+ CHANGED=1
+ fi
+ shift
+done
+
+if [ $CHANGED -eq 1 ]; then
+ sudo cp $OUT /etc/default/docker
+ sudo service docker restart
+fi
+rm -f $OUT