Alexey Deryugin b4bb6a2191 Fix missing function call in Docker DIB element
Replace call of undefined function 'lowercase' with standart bash string conversion to lowercase

Change-Id: I7fa4a85058e81afbd72d2f245c66995afc5ce26a
Closes-Bug: #1465282
2015-06-15 14:09:17 +00:00

34 lines
963 B
Bash
Executable File

#!/bin/bash
set -eu
os=$(uname)
dist_name='Unknown'
if [ "${os}" = "Linux" ] ; then
if [ -f /etc/redhat-release ] ; then
dist_name=$(cat /etc/redhat-release |sed s/\ release.*//)
elif [ -f /etc/SuSE-release ] ; then
dist_name='SuSe'
elif [ -f /etc/lsb-release ]; then
dist=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }')
fi
fi
# Convert ditribition name to lowercase
dist_name=${dist_name,,}
if [ "${dist_name}" == 'ubuntu' ]; then
if [ -e /usr/lib/apt/methods/https ]; then
apt-get update
apt-get install apt-transport-https
fi
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo "deb https://get.docker.com/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get -y install lxc-docker=1.6.2
else
install-packages curl
curl -sSL https://get.docker.com/ | sh
fi