#!/bin/sh

set -e

if ["null" != $PRIVATE_REGISTRIES] ;then    
sudo sed -i '18i-insecureDockerRegistryList='$PRIVATE_REGISTRIES' \\' /etc/init/garden-linux.conf
sudo initctl stop garden-linux
sudo initctl start garden-linux
fi
#!/bin/sh

set -e

if [ $PRIVATE_REGISTRIES != 'null' ]
then
line=$((`sudo sed -n '$=' /etc/init/garden-linux.conf`-5))
sudo sed -i $line'i-insecureDockerRegistryList='$PRIVATE_REGISTRIES' \\' /etc/init/garden-linux.conf
sudo initctl stop garden-linux
sudo initctl start garden-linux
fi
Fix the problem the length of the garden config file may change.
Fix the problem the length of the garden config file may change.

Signed-off-by: LaynePeng <b42b02109bc745c62919567dc0f7be6c65db2f90@hotmail.com>
