Created
August 9, 2011 20:35
-
-
Save hhoover/1135125 to your computer and use it in GitHub Desktop.
lscloudkick function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function ostype() { | |
if [ -e /etc/redhat-release ]; then | |
export distro="Redhat/CentOS" | |
else | |
if [ "$(lsb_release -d | awk '{print $2}')" == "Ubuntu" ];then | |
export distro="Ubuntu" | |
else | |
echo -e "could not detect operating system" && export distro="Other" | |
fi | |
fi | |
} | |
function lscloudkick() { | |
if [[ $distro = "Redhat/CentOS" ]]; then | |
cat > /etc/yum.repos.d/cloudkick.repo <<-EOF | |
[cloudkick] | |
name=Cloudkick | |
baseurl=http://packages.cloudkick.com/redhat/x86_64 | |
gpgcheck=0 | |
EOF | |
yum -y -q install cloudkick-agent | |
chkconfig cloudkick-agent on | |
echo -e "Please enter the login credentials and start the agent." | |
cloudkick-config | |
elif [ "${distro}" == "Ubuntu" ]; then | |
echo 'deb http://packages.cloudkick.com/ubuntu lucid main' > /etc/apt/sources.list.d/cloudkick.list | |
curl http://packages.cloudkick.com/cloudkick.packages.key | apt-key add - | |
apt-get -q update | |
apt-get -y -q install cloudkick-agent | |
echo -e "Please enter the login credentials and start the agent." | |
cloudkick-config | |
else | |
echo "Unsupported OS. See https://support.cloudkick.com/Category:Installing_Cloudkick" | |
exit | |
fi | |
} | |
ostype | |
lscloudkick |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment