Skip to content

Instantly share code, notes, and snippets.

@bmuller
Created April 8, 2013 14:25
Show Gist options
  • Select an option

  • Save bmuller/5337164 to your computer and use it in GitHub Desktop.

Select an option

Save bmuller/5337164 to your computer and use it in GitHub Desktop.
Connect to NYTimes wireless network
#!/bin/bash
USER=your-username
PASSWORD=your-password
DEST=$(wget "http://google.com" --no-check-certificate -O - -S -q 2>&1 | grep Location | cut -d ' ' -f 4)
if [ "$DEST" == "http://www.google.com/" ]; then
echo "You're already connected to the tubes."
exit 1
fi
wget --no-check-certificate -O - --post-data "user=$USER&password=$PASSWORD" $DEST &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment