generate /etc/sysconfig/docker have some error,the daisy_management_ip should be given by daisy server

Change-Id: Icd65a3315bd7882b50ad23c77bf0fa092bbece9c
Signed-off-by: luyao <lu.yao135@zte.com.cn>
This commit is contained in:
luyao 2016-07-27 15:04:41 +08:00
parent 4f7207c919
commit f08558360a
1 changed files with 2 additions and 9 deletions

View File

@ -1,19 +1,12 @@
#! /bin/bash
daisy_management_ip=$1
yum -y install epel-release
curl -sSL https://get.docker.io | bash
mkdir -p /etc/systemd/system/docker.service.d
config_path=/etc/systemd/system/docker.service.d/kolla.conf
daisy_config_file="/home/daisy_install/daisy.conf"
line=`sed '/^[[:space:]]*#/d' $daisy_config_file | sed /^[[:space:]]*$/d | grep -w "daisy_management_ip"| grep "daisy_management_ip[[:space:]]*=" -m1`
if [ -z "$line" ]; then
echo "daisy_management_ip of daisy.conf can't be empty!"
exit 1
else
daisy_management_ip=`echo $line | sed 's/=/ /' | sed -e 's/^\w*\ *//'`
fi
touch /etc/sysconfig/docker
echo -e "other_args="--insecure-registry $daisy_management_ip:4000"" > /etc/sysconfig/docker
echo -e "other_args=\"--insecure-registry $daisy_management_ip:4000\"" > /etc/sysconfig/docker
echo -e "[Service]\nMountFlags=shared\nEnvironmentFile=/etc/sysconfig/docker\nExecStart=\nExecStart=/usr/bin/docker daemon -H fd:// \$other_args" > $config_path
systemctl daemon-reload
systemctl restart docker