4
|
1 #!/bin/sh
|
|
2 #
|
14
|
3 # $Id: tm-html,v 1.3 1997/01/11 22:09:59 steve Exp $
|
4
|
4 #
|
|
5
|
14
|
6 PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
|
|
7
|
4
|
8 if [ "$TM_TMP_DIR" = "" ]; then
|
|
9 TM_TMP_DIR=/tmp
|
|
10 export TM_TMP_DIR
|
|
11 fi
|
|
12
|
|
13 if [ "$TM_WWW_BROWSER" = "" ]; then
|
|
14 TM_WWW_BROWSER=netscape
|
|
15 export TM_WWW_BROWSER
|
|
16 fi
|
|
17
|
|
18 if [ "$5" = "" ]; then
|
|
19 filename="$TM_TMP_DIR/mime$$.html"
|
|
20 else
|
|
21 filename="$TM_TMP_DIR/$5"
|
|
22 fi
|
|
23
|
|
24 echo "$2; $3 -> $filename"
|
|
25
|
|
26 tmdecode "$3" $1 $filename
|
|
27
|
|
28 case "$4" in
|
|
29 "play")
|
|
30 if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then
|
|
31 echo netscape
|
|
32 if [ -h $HOME/.netscape/lock ]; then
|
|
33 netscape -remote "openURL(file:$filename,new-window)"
|
|
34 else
|
|
35 netscape $filename
|
|
36 fi
|
|
37 else
|
|
38 echo not netscape
|
|
39 $TM_WWW_BROWSER $filename
|
|
40 fi
|
|
41 trap 'rm -f $filename' 0 1 2 3 13 15
|
|
42 ;;
|
|
43 "extract")
|
|
44 echo "extract to $filename"
|
|
45 ;;
|
|
46 esac
|