File: kvi2_run_netscape

package info (click to toggle)
kvirc2 2.1.3-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,308 kB
  • ctags: 9,533
  • sloc: cpp: 86,257; sh: 10,532; makefile: 631; perl: 419; ansic: 315; sed: 16
file content (20 lines) | stat: -rw-r--r-- 400 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh

set -e

if [ -z "$1" ]; then
	echo "Missing URL"
else
	if which netscape > /dev/null; then
		BROWSER=netscape
	elif which mozilla > /dev/null; then
		BROWSER=mozilla
	else
		echo "Could not find either Netscape or Mozilla"
		exit 0
	fi
	if ! $BROWSER -remote "openUrl($1)" 2> /dev/null; then
		echo "$BROWSER is not currently running. Starting a new instance..."
		$BROWSER "$1" &
	fi
fi