#!/bin/sh
path="/opt/timecard"
binary="$path/timecard"
profile="$HOME/.fermitimecard/timecardprofile"

# First check to see if the user has the correct profile
#  If they don't have the profile, make it for them
if ! [ -d $profile ] ; then
	echo "  We need to create your local profile"
	mkdir $HOME/.fermitimecard > /dev/null 2>&1
	cp -r $path/profile/fermitimecard $profile
fi

# Now run the program
#  We run it as a differnt profile
#  We run it with -no-remote so it runs by itself

echo "NOTE1: This browser is firefox based - Firefox 3.5.9"
echo "NOTE2: (yes this is an if/then statement)"
echo "    IF you have not opened your default firefox before starting"
echo "fermi-timecard"
echo "    AND you do not close fermi-timecard before starting your default
firefox"
echo "    THEN it will just create a new window based on the fermi-timecard"
echo "browser.  You will not like this due to its lack of menu, navigation,"
echo "and bookmarks."
echo "    To fix this, just close all of your fermi-timecard browser windows."
echo "    FI"

$binary -no-remote -profile $profile
