Skip to content

Instantly share code, notes, and snippets.

@juliosmelo
Created September 25, 2014 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save juliosmelo/6c7c2be4f16c1c874ec2 to your computer and use it in GitHub Desktop.
Save juliosmelo/6c7c2be4f16c1c874ec2 to your computer and use it in GitHub Desktop.
# simples fabfile para aplicar o patch para o bug CVE-2014-6271
__author__ = 'juliomelo'
from fabric.api import *
from fabric.decorators import hosts
import re
env.use_ssh_config=True
@hosts('host_foo', 'host_bar')
@task
def bashbug():
so = run('cat /etc/issue')
arch = run('arch')
if re.search(u'Ubuntu', so):
sudo('apt-get update')
sudo('apt-get --only-upgrade install bash -y')
elif re.search(u'CentOS', so):
if arch == 'x86_64':
run('yum update bash.x86_64')
elif arch == 'i386':
run('yum update bash.i386')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment