3
# url_handler.sh for SuSE Linux
5
# Copyright (c) 2000 SuSE GmbH Nuernberg, Germany.
7
# Author: Werner Fink <werner@suse.de>
12
if test "$url" = "$method" ; then
14
www|web|w3) method=http ;;
15
mail|mailx) method=mailto ;;
16
gopher) method=gopher ;;
19
*/*.htm|*/*.html) method=http ;;
20
*/*.htmls) method=https ;;
22
/*) if test -r "${url}" ; then
30
mailto|file) url="${method}:$url" ;;
31
*) url="${method}://$url" ;;
35
### an alternative method of handling "news:*" URL's
37
# if test "$method" = "news" ; then
38
# url="http://www.deja.com/[ST_rn=if]/topics_if.xp?search=topic&group=${url#news:}"
47
if type -p ncftp >& /dev/null ; then
51
echo "=====> Paste this command by mouse:"
57
file|http|https|gopher)
59
type -p lynx >& /dev/null && http=lynx
60
test -n "$DISPLAY" && type -p netscape >& /dev/null && http=netscape
61
test -n "$DISPLAY" && type -p Netscape >& /dev/null && http=Netscape
63
[nN]etscape) $http -remote "openURL($url)" || $netscape "$url" ;;
64
lynx) exec $http "$url" ;;
66
echo "No HTTP browser found."
67
read -p "Press return to continue: "
68
exit 0 # No error return
74
if type -p ${MAILER} >& /dev/null ; then
75
exec ${MAILER} "${url#mailto:}"
77
echo "No mailer ${MAILER} found in path."
78
echo "Please check your environment variable MAILER."
79
read -p "Press return to continue: "
80
exit 0 # No error return
84
echo "URL type \"$method\" not know"
85
read -p "Press return to continue: "
86
exit 0 # No error return