Skip to content

Instantly share code, notes, and snippets.

@gabtastic
Last active August 28, 2015 03:16
Show Gist options
  • Save gabtastic/910402ed1d027a5be332 to your computer and use it in GitHub Desktop.
Save gabtastic/910402ed1d027a5be332 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Supervisor Agent Easy install
# Execute like this:
# curl -k https://gist.githubusercontent.com/gabtastic/910402ed1d027a5be332/raw -s | sh
function installpackage {
echo "Installing $1"
if rpm -q $1 > /dev/null;
then
echo " $1 package already installed ..."
else
sudo yum install -y $1 > /dev/null;
fi
}
function removepackage {
if rpm -q $1 > /dev/null;
then
sudo yum remove $1 > /dev/null;
else
echo "$1 package not installed."
fi
}
# Install gem fury repo
echo "Installing gemfury repo"
if [ ! -e /etc/yum.repos.d/gemfury.repo ]
then
sudo bash -c 'cat << EOF > /etc/yum.repos.d/gemfury.repo
[fury]
name=Gemfury Private Repo
baseurl=https://repo.fury.io/wQUZrGXsyxMh5KMQx3W4/intello/
enabled=1
gpgcheck=0
EOF'
fi
# Remove ruby 1.8.5 if installed
removepackage ruby-1.8.5
# install dependencies`
installpackage epel-release
installpackage libyaml
installpackage ruby.i386
installpackage rubygem-eventmachine
installpackage rubygem-websocket-extensions
installpackage rubygem-websocket-driver
installpackage rubygem-hiredis
installpackage rubygem-unf_ext
installpackage rubygem-hitimes
installpackage rubygem-mysql
installpackage redis
# Start REDIS
sudo /etc/init.d/redis start
# Your environment should be set properly
# Missing /etc/profile.d/panorama.sh
if [ ! -e /etc/profile.d/panorama.sh ]
then
echo 'You are missing the environment profile panorama.sh in /etc/profile.d'
echo 'Creating basic config'
sudo bash -c 'cat << EOF > /etc/profile.d/panorama.sh
export PEPLINK_USERNAME=""
export PEPLINK_PASSWORD=""
export PEPLINK_PORT=""
export ZONEDIRECTOR_USERNAME=""
export ZONEDIRECTOR_PASSWORD=""
'
fi
# Install supervisor gem ...
echo "Installing supervisor-agent gem"
sudo gem install supervisor-agent --pre --no-ri --no-rdoc --source https://[email protected]/intello/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment