David K. Bainbridge | 119a3b0 | 2016-06-16 18:10:30 -0700 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
3 | PROG=$(basename $0) | ||||
4 | |||||
5 | HELP=$(echo "$*" | grep "\-h" | wc -w) | ||||
6 | |||||
7 | if [ $HELP -ne 0 ]; then | ||||
8 | echo "usage: $PROG <remote-registry>..." | ||||
9 | exit 1 | ||||
10 | fi | ||||
11 | |||||
12 | OUT=$(tempfile) | ||||
13 | head -1 /etc/default/docker >> $OUT | ||||
14 | while [ $# -gt 0 ]; do | ||||
15 | echo "DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" >> $OUT | ||||
16 | shift | ||||
17 | done | ||||
18 | |||||
19 | sudo cp $OUT /etc/default/docker | ||||
20 | rm $OUT | ||||
21 | |||||
22 | sudo service docker restart |