Last active
August 28, 2015 03:01
-
-
Save gabtastic/aa3efd902d940e4c2c34 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
# Supervisor Agent Easy install | |
# Execute like this: | |
# curl -k https://gist.githubusercontent.com/gabtastic/aa3efd902d940e4c2c34/raw?sd -s | sh | |
function installpackage { | |
if rpm -q $1 > /dev/null; | |
then | |
echo " $1 package already installed ..." | |
else | |
echo " installing" | |
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 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