#!/bin/bash

run_if_not_already() {
	prog="$1"
	proc="${2:-$prog}"
	if pidof "$proc" >/dev/null; then
		echo "$prog already running" 
	else
		"$prog" &
	fi
}

firefox http://fastmail.fm/beta http://www.facebook.com/ http://www.friendster.com/ &
run_if_not_already thunderbird thunderbird-bin
run_if_not_already skype skype.real
run_if_not_already pidgin
