4
|
1 #!/bin/sh
|
|
2 #
|
16
|
3 # $Id: tm-html,v 1.4 1997/02/02 05:04:53 steve Exp $
|
4
|
4 #
|
16
|
5 # Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
|
|
6
|
|
7 # This program is free software; you can redistribute it and/or modify
|
|
8 # it under the terms of the GNU General Public License as published by
|
|
9 # the Free Software Foundation; either version 2, or (at your option)
|
|
10 # any later version.
|
|
11 #
|
|
12 # This program is distributed in the hope that it will be useful,
|
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 # GNU General Public License for more details.
|
|
16 #
|
|
17 # You should have received a copy of the GNU General Public License
|
|
18 # along with GNU Emacs; see the file COPYING. If not, write to the
|
|
19 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 # Boston, MA 02111-1307, USA.
|
4
|
21
|
14
|
22 PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
|
|
23
|
4
|
24 if [ "$TM_TMP_DIR" = "" ]; then
|
|
25 TM_TMP_DIR=/tmp
|
|
26 export TM_TMP_DIR
|
|
27 fi
|
|
28
|
|
29 if [ "$TM_WWW_BROWSER" = "" ]; then
|
|
30 TM_WWW_BROWSER=netscape
|
|
31 export TM_WWW_BROWSER
|
|
32 fi
|
|
33
|
|
34 if [ "$5" = "" ]; then
|
|
35 filename="$TM_TMP_DIR/mime$$.html"
|
|
36 else
|
|
37 filename="$TM_TMP_DIR/$5"
|
|
38 fi
|
|
39
|
|
40 echo "$2; $3 -> $filename"
|
|
41
|
|
42 tmdecode "$3" $1 $filename
|
|
43
|
|
44 case "$4" in
|
|
45 "play")
|
|
46 if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then
|
|
47 echo netscape
|
|
48 if [ -h $HOME/.netscape/lock ]; then
|
|
49 netscape -remote "openURL(file:$filename,new-window)"
|
|
50 else
|
|
51 netscape $filename
|
|
52 fi
|
|
53 else
|
|
54 echo not netscape
|
|
55 $TM_WWW_BROWSER $filename
|
|
56 fi
|
|
57 trap 'rm -f $filename' 0 1 2 3 13 15
|
|
58 ;;
|
|
59 "extract")
|
|
60 echo "extract to $filename"
|
|
61 ;;
|
|
62 esac
|