diff --git a/firefox-wrapper/Makefile b/firefox-wrapper/Makefile index fecfd20ac1..9de0c1cdb5 100644 --- a/firefox-wrapper/Makefile +++ b/firefox-wrapper/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.7 2005/11/02 18:00:13 thomasklausner Exp $ +# $NetBSD: Makefile,v 1.8 2006/04/16 23:52:29 poppnk Exp $ -DISTNAME= firefox-wrapper-0.2 +DISTNAME= firefox-wrapper-0.3 CATEGORIES= www MASTER_SITES= # empty DISTFILES= # empty diff --git a/firefox-wrapper/files/firefox b/firefox-wrapper/files/firefox index 1899acf9b5..4e917cccef 100644 --- a/firefox-wrapper/files/firefox +++ b/firefox-wrapper/files/firefox @@ -8,24 +8,26 @@ if [ -e "${HOME}/.firefox-wrapper.conf" ]; then . ${HOME}/.firefox-wrapper.conf fi -if [ "${FIREFOX_BIN}" = "" ]; then +if [ -z "${FIREFOX_BIN}" ]; then echo "Please define FIREFOX_BIN in _etc_/firefox-wrapper.conf" exit 1 fi -if [ "${OPEN_MODE}" = "" ]; then + +if [ -z "${OPEN_MODE}" ]; then echo "Please define OPEN_MODE in _etc_/firefox-wrapper.conf" echo "Valid values are: 'new-window', 'new-tab', 'current'" exit 1 fi -if [ ! "${OPEN_MODE}" = "new-tab" ]; then -if [ ! "${OPEN_MODE}" = "new-window" ]; then -if [ ! "${OPEN_MODE}" = "current" ]; then + +case "${OPEN_MODE}" in +"new-tab"|"new-window"|"current") + ;; +*) echo "Invalid value in OPEN_MODE" echo "Valid values are: 'new-window', 'new-tab', 'current'" exit 1 -fi -fi -fi + ;; +esac if [ ! -x ${FIREFOX_BIN} ]; then echo "${FIREFOX_BIN}: cannot execute." @@ -36,10 +38,14 @@ fi ${FIREFOX_BIN} -remote "ping()" if [ "$?" = "0" ]; then # firefox is running - if [ "${OPEN_MODE}" = "current" ]; then - ${FIREFOX_BIN} -remote "openURL($1)" + if [ -z "$1" ]; then + ${FIREFOX_BIN} else - ${FIREFOX_BIN} -remote "openURL($1,${OPEN_MODE})" + if [ "${OPEN_MODE}" = "current" ]; then + ${FIREFOX_BIN} -remote "openURL($1)" + else + ${FIREFOX_BIN} -remote "openURL($1,${OPEN_MODE})" + fi fi else ${FIREFOX_BIN} $1