Created
September 25, 2014 13:56
-
-
Save juliosmelo/6c7c2be4f16c1c874ec2 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
# 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