Skip to content

Instantly share code, notes, and snippets.

@ludo
Created September 6, 2012 10:30
Show Gist options
  • Save ludo/3654564 to your computer and use it in GitHub Desktop.
Save ludo/3654564 to your computer and use it in GitHub Desktop.
function log {
echo -e "\033[1;31m>> \033[0;34m$*\033[0m"
}
function error {
echo -e "\033[1;31m!! \033[1;31m$*\033[0m"
}
function ask {
echo -e "\033[1;32m?? \033[0;32m$*\033[0m"
}
function pause {
read -p "$*"
}
# Check if Git is installed
log "Checking for Git"
if [ ! $(which git 2>/dev/null) ]; then
apt-get install git
if [ ! $(which git 2>/dev/null) ]; then
error "Git not found"
exit
else
log "Git installed, continuing..."
fi
else
log "Git found, continuing..."
fi
# Set up puppet-common
log "Checking for Puppet"
if [ ! $(which puppet 2>/dev/null) ]; then
apt-get install puppet-common
if [ ! $(which puppet 2>/dev/null) ]; then
error "Puppet not found"
exit
else
log "Puppet installed, continuing..."
fi
else
log "Puppet found, continuing..."
fi
# Set up SSH server
log "Checking for OpenSSH"
if [ ! $(which sshd 2>/dev/null) ]; then
apt-get install openssh-server
if [ ! $(which sshd 2>/dev/null); then
error "OpenSSH not found"
exit
else
log "OpenSSH installed, continuing..."
fi
else
log "openSSH found, continuing..."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment