summaryrefslogtreecommitdiffstats
path: root/scripts/browser/kvi_run_netscape
blob: 4ee301a44567f9bd00feaedfde63e3c87f9ee4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh

set -e

BROWSER=

if [ -z "$1" ]; then
	echo "Missing URL"
else
	for BROWSER in firefox seamonkey mozilla netscape ""; do
		if [ -z "$BROWSER" ]; then 
			echo "Could not find either Netscape or Mozilla"
			exit 0
		fi
		if which "$BROWSER" > /dev/null; then
			break;
		fi
	done
		
	if ! "$BROWSER" -remote "openURL($1)" 2> /dev/null; then
		echo "$BROWSER is not currently running. Starting a new instance..."
		exec "$BROWSER" "$1"
	fi
fi