File: mozilla_helper.sh

package info (click to toggle)
chmlib 2%3A0.40a-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,480 kB
  • sloc: sh: 10,113; ansic: 2,625; makefile: 85
file content (20 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# redirect to another port on localhost
# this is meant to run as a helper application under mozilla

host=127.0.0.1
port=8081
echo "unpacking :$*: on $host:$port" >/tmp/chm.log
chm_http --port=$port --bind=$host "$*" >chm.log 2>&1 &

HTTP=/tmp/chm2http.html
echo "<html><head><title>$*</title>" >$HTTP
echo "<meta http-equiv='refresh' content=\"5; url=http://$host:$port/\">" >>$HTTP
echo "<title>working</title></head>" >>$HTTP
echo "<body>please wait while I unpack :$*:<br>working...<br><br>" >>$HTTP
echo "chm_http reports:<br>" >>$HTTP
cat chm.log >>$HTTP
echo "</body></html>" >>$HTTP

mozilla -remote "openURL($HTTP)"
rm -f /tmp/chm.log /tmp/chm2http.html