Created
December 27, 2011 15:35
-
-
Save weavenet/1524036 to your computer and use it in GitHub Desktop.
Disable DNS lookup when starting WEBrick
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
#!/bin/bash | |
if [ `whoami` != "root" ]; then | |
echo "$0 must be run as root." | |
exit 1 | |
fi | |
for i in $(locate webrick/config.rb); do | |
echo "Processing $i" | |
sed -e 's/^.*:DoNotReverseLookup => nil,$/:DoNotReverseLookup => true,/' $i > /tmp/config.rb | |
if [ $? -ne 0 ]; then | |
echo "Error processing file" | |
exit 1 | |
fi | |
/bin/cp /tmp/config.rb $i | |
/bin/rm /tmp/config.rb | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment