Skip to content

Instantly share code, notes, and snippets.

@daraosn
Last active August 29, 2015 14:06
Show Gist options
  • Save daraosn/97b7332f2cb1092037dc to your computer and use it in GitHub Desktop.
Save daraosn/97b7332f2cb1092037dc to your computer and use it in GitHub Desktop.
[OSX] Shockshell bash patch
#!/bin/bash
if [ ! $(command -v brew) ]; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ ! -f /bin/bash.bak ]; then
brew update
brew install bash
brew upgrade bash
sudo mv /bin/bash /bin/bash.bak
sudo rm /bin/bash
sudo ln -s /usr/local/bin/bash /bin/bash
else
echo "The patch has already been applied (aka you already have a /bin/bash.bak file)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment