Skip to content

Instantly share code, notes, and snippets.

@stevejenkins
Last active August 29, 2015 14:06
Show Gist options
  • Save stevejenkins/3d64d3543060c1bcac92 to your computer and use it in GitHub Desktop.
Save stevejenkins/3d64d3543060c1bcac92 to your computer and use it in GitHub Desktop.
A quick script file for downloading an applying multiple patches when manually compiling GNU bash on Linux. Referenced in this post: http://stevejenkins.com/blog/2014/09/how-to-manually-update-bash-to-patch-shellshock-bug-on-older-fedora-based-systems/
#!/bin/sh
# A quick script file for downloading an applying multiple patches when manually compiling GNU bash on Linux
# Written (mostly) by Steve Cook with (a little) help from Steve Jenkins
# This really seems like a lame way to have to do this, but it works. :) Use at your own risk.
# You can edit these variables
version="4.0"
nodotversion="40"
lastpatch="44"
# You probably don't want to edit anything below this line
for i in `seq 1 $lastpatch`;
do
number=$(printf %02d $i)
file="https://ftp.gnu.org/pub/gnu/bash/bash-${version}-patches/bash${nodotversion}-0$number"
echo $file
curl -k $file | patch -N -p0
done
@jakobkroeker
Copy link

could an integrity check be added, too ? (gpg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment