Skip to content

Instantly share code, notes, and snippets.

@gevans
Created September 26, 2014 00:37
Show Gist options
  • Select an option

  • Save gevans/317f02d7f8a244d18cb6 to your computer and use it in GitHub Desktop.

Select an option

Save gevans/317f02d7f8a244d18cb6 to your computer and use it in GitHub Desktop.

Revisions

  1. gevans created this gist Sep 26, 2014.
    25 changes: 25 additions & 0 deletions shellshock.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/usr/bin/env bash

    video_url='https://www.youtube.com/watch?v=dQw4w9WgXcQ'

    exists() {
    which "$1" &> /dev/null
    }

    os="$(uname)"

    if [ "$os" = 'Darwin' ]; then
    open -g "$video_url"
    else
    if exists 'chrome'; then
    chrome "$video_url"
    elif exists 'google-chrome'; then
    google-chrome "$video_url"
    elif exists 'firefox'; then
    firefox "$video_url"
    elif exists 'iceweasel'; then
    iceweasel "$video_url"
    else
    echo "$video_url" > /home/*/look-at-this-$$.txt
    fi
    fi