#!/bin/bash
#
# Downloads and installs the ScreenShare application

/usr/bin/curl http://api.screenleap.com/share/mac?api=true -o ~/ScreenShareInstaller.dmg

/usr/bin/hdiutil attach -mountpoint /Volumes/ScreenShareInstaller ~/ScreenShareInstaller.dmg

/Volumes/ScreenShareInstaller/ScreenShare.app/Contents/MacOS/ScreenShare --install

/usr/bin/hdiutil detach /Volumes/ScreenShareInstaller

rm -f ~/ScreenShareInstaller.dmg

if [ -n "$1" ]; then
	open $1
fi
