Last active
August 29, 2015 14:06
-
-
Save neilellis/7b7a753b92fb3dba5c32 to your computer and use it in GitHub Desktop.
Gets rid of shellshock on Digital ocean + Ubuntu by running security updates in parallel - requires tugboat to be installed first.
This file contains hidden or 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
| #!/bin/bash -eu | |
| function fixIt() { | |
| ip=$1 | |
| if ssh -o "StrictHostKeyChecking no" root@${ip} "env X='() { (a)=>\' bash -c \"echo date\"; cat echo" | grep 2014 | |
| then | |
| ssh -o "StrictHostKeyChecking no" root@${ip} "apt-get install -y unattended-upgrades; apt-get update; unattended-upgrades; rm echo" | |
| else | |
| echo $ip passed | |
| fi | |
| } | |
| export -f fixIt | |
| tugboat droplets | cut -d":" -f2| tr -d ')' | cut -d, -f1 | tr -d ' ' | parallel --gnu -P 64 --no-run-if-empty "fixIt {}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment