~ubuntu-branches/ubuntu/utopic/edbrowse/utopic

« back to all changes in this revision

Viewing changes to doc/setup.ebrc

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2008-04-09 18:55:23 UTC
  • mfrom: (1.1.4 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080409185523-dqokcloumyn1ibn4
Tags: 3.3.4-1
* New upstream version (3.3.4).
 - Convert between iso8859-1 and utf-8 on the fly.
 - Support reading of pdf using pdftohtml.
 - French translation of html documentation.
 - Old html documentation renamed to usersguide.
 - Additional documentation on philosophy.
* debian/control:
 - Changed homepage to sourcefource site.
 - Moved homepage from description to its own field.
 - Added "poppler-utils | xpdf-utils" to Recommends.
 - Added "www-browser", "mail-reader" and "editor" to Provides. 
 - Removed "XS-" from Vcs-Svn tag.
 - Standards-Version: 3.7.3
* debian/docs: Added new documentation files
  from "doc/" subdirectory.
* debian/watch: Updated to use sourceforge site.
* debian/edbrowse.doc-base:
  - Changed name of upstream provided html documentation from
    "ebdoc.html" to "usersguide.html".
  - Changed section from "net" to "Network/Web Browsing".
* debian/install: Compiled binary is now in "src/".

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
#  This script interviews a new user of edbrowse,
 
4
#  and creates an initial version of the .ebrc config file.
 
5
#  The config file can be edited thereafter.
 
6
 
 
7
#  Abort if an error occurs
 
8
set -e
 
9
 
 
10
question=
 
11
#  default answer
 
12
defans=
 
13
 
 
14
shellknown=n
 
15
if [ $SHELL = /bin/bash ]
 
16
then
 
17
shellknown=y
 
18
shellstart=.bash_login
 
19
shellfns=.bashrc
 
20
fi
 
21
 
 
22
function response()
 
23
{
 
24
echo -n "$question"
 
25
if [ -n "$defans" ]
 
26
then
 
27
echo -n " [$defans]"
 
28
fi
 
29
echo -n ": "
 
30
read answer
 
31
if [ -z "$answer" ]
 
32
then
 
33
answer=$defans
 
34
fi
 
35
}
 
36
 
 
37
function responsenumber()
 
38
{
 
39
while true
 
40
do
 
41
response
 
42
if [ -z "${answer/[0-9]*/}" ]
 
43
then
 
44
break
 
45
fi
 
46
echo "Please enter a number."
 
47
done
 
48
}
 
49
 
 
50
function responserange()
 
51
{
 
52
start=$1
 
53
end=$2
 
54
while true
 
55
do
 
56
responsenumber
 
57
if [ $answer -ge $start -a $answer -le $end ]
 
58
then
 
59
break
 
60
fi
 
61
echo "Please enter a number between $start and $end."
 
62
done
 
63
}
 
64
 
 
65
#  respond with a certain letter
 
66
function responselrs()
 
67
{
 
68
lrs=$1
 
69
while true
 
70
do
 
71
response
 
72
answer=${answer:0:1}
 
73
if [ -z "${answer/[$lrs]/}" ]
 
74
then
 
75
break
 
76
fi
 
77
echo "Please enter one of the letters $lrs."
 
78
done
 
79
}
 
80
 
 
81
function responseyn()
 
82
{
 
83
while true
 
84
do
 
85
response
 
86
answer=${answer:0:1}
 
87
if [ "$answer" = y -o "$answer" = n ]
 
88
then
 
89
break
 
90
fi
 
91
echo "Please enter y or n."
 
92
done
 
93
}
 
94
 
 
95
function hitreturn()
 
96
{
 
97
question="Hit return to continue"
 
98
defans=
 
99
response
 
100
}
 
101
 
 
102
#  edbrowse config file
 
103
ebcf=$HOME/.ebrc
 
104
function configstart()
 
105
{
 
106
if [ ! -f $ebcf ]
 
107
then
 
108
echo "I am creating your edbrowse config file in $ebcf.
 
109
I will write text into this file as we go along.
 
110
This file contains passwords, and should not be readable by others.
 
111
I will set the permissions accordingly; please leave it at 600.
 
112
"
 
113
 
 
114
echo '#  edbrowse configuration file.
 
115
#  You can edit this file via edbrowse -c.
 
116
 
 
117
#  autosetup 1' >$ebcf
 
118
chmod 600 $ebcf
 
119
 
 
120
sleep 3
 
121
echo "File created successfully.
 
122
"
 
123
sleep 2
 
124
fi
 
125
 
 
126
lastline=`tail -1 $ebcf`
 
127
level=${lastline:13}
 
128
prelevel=${lastline:3:9}
 
129
}
 
130
 
 
131
configstart
 
132
 
 
133
if [ "$prelevel" != autosetup ]
 
134
then
 
135
echo "You already have an edbrowse config file in place;
 
136
I will be working with the file $ebcf.new.
 
137
When we're done, you can move this back to $ebcf, but beware,
 
138
you will lose all the configuration information that you currently have in that file.
 
139
"
 
140
sleep 2
 
141
ebcf=$ebcf.new
 
142
 
 
143
configstart
 
144
fi
 
145
 
 
146
if [ "$prelevel" != autosetup ]
 
147
then
 
148
echo "Your .ebrc.new file seems to be complete, or corrupted.
 
149
I cannot safely update either of these files.
 
150
Please remove one or both of them, and start this script again."
 
151
exit 1
 
152
fi
 
153
 
 
154
if [ $level = 1 ]
 
155
then
 
156
echo "*** level 1, default behaviors ***
 
157
"
 
158
 
 
159
echo "The debug level determines the amount of output you will receive.
 
160
0 is silent, except for errors.
 
161
1 prints the size of each file as it is read or written.
 
162
2 prints the different urls as you are redirected from one website to another.
 
163
Higher levels crank out more output, but you probably don't want to see that.
 
164
Most people like level 1."
 
165
question="Enter debug level"
 
166
defans=1
 
167
responserange 0 4
 
168
dblev=$answer
 
169
echo
 
170
 
 
171
echo "When a simple error occurs, I usually print out a question mark,
 
172
and nothing more.  I can however print the error message every time.
 
173
Most people like the quick question marks for simple typos."
 
174
question="Do you want to read the error message every time"
 
175
defans=n
 
176
responseyn
 
177
Hon=$answer
 
178
echo
 
179
 
 
180
echo "When scanning through a directory, it is readonly by default.
 
181
This means you cannot delete a file, simply by deleting the corresponding line.
 
182
You can change this behavior so that deleted files are moved
 
183
to your trash bin, or deleted altogether.
 
184
r = directories are readonly.
 
185
m = deleted files move to your trash bin.
 
186
x = deleted files go away forever."
 
187
question="How should deletes in directory mode behave"
 
188
defans=m
 
189
responselrs rmx
 
190
dmode=dw
 
191
if [ "$answer" = r ]
 
192
then
 
193
dmode=dr
 
194
fi
 
195
if [ "$answer" = x ]
 
196
then
 
197
dmode=dx
 
198
fi
 
199
echo
 
200
 
 
201
echo "When you edit a directory, some files are hidden by default.
 
202
These are the files that begin with a dot, like .ebrc."
 
203
question="Do you want to see these files"
 
204
defans=n
 
205
responseyn
 
206
hf=$answer
 
207
echo
 
208
 
 
209
echo "When a line is listed with the l command,
 
210
I can put ^ at the beginning of the line and $ at the end.
 
211
Or I can do this all the time.
 
212
o = end markers off.
 
213
l = end markers on listed lines.
 
214
p = end markers every time I print a line."
 
215
question="When do you want ^ $ markers to appear"
 
216
defans=o
 
217
responselrs olp
 
218
endmarks=eo
 
219
if [ "$answer" = l ]
 
220
then
 
221
endmarks=el
 
222
fi
 
223
if [ "$answer" = p ]
 
224
then
 
225
endmarks=ep
 
226
fi
 
227
echo
 
228
 
 
229
(
 
230
echo "#  The init function is run when edbrowse is started.
 
231
#  It can be used to establish the settings you want,
 
232
#  or preload common files such as your bookmarks etc.
 
233
function+init {
 
234
#  debug level is 0 at the start, to avoid a lot of messages at startup
 
235
db0
 
236
#  end markers for listed lines
 
237
$endmarks"
 
238
if [ $hf = y ]
 
239
then
 
240
echo "#  Show hidden files in a directory
 
241
hf"
 
242
fi
 
243
echo "#  Manage deleted files in directory mode
 
244
$dmode"
 
245
if [ $Hon = y ]
 
246
then
 
247
echo "#  Show the error messages every time.
 
248
H"
 
249
fi
 
250
if [ $dblev != 0 ]
 
251
then
 
252
echo "#  set the debug level
 
253
db$dblev"
 
254
fi
 
255
echo '}
 
256
 
 
257
#  autosetup 2'
 
258
) >>$ebcf
 
259
 
 
260
level=2
 
261
fi
 
262
 
 
263
if [ $level = 2 ]
 
264
then
 
265
echo "*** level 2, special edbrowse files ***
 
266
"
 
267
 
 
268
echo "Many people put their bookmarks, email addresses, certificates, etc in an edbrowse directory.
 
269
Enter a directory now, or just hit return for the default."
 
270
question="Edbrowse system directory"
 
271
defans=$HOME/.eb
 
272
response
 
273
ebdir=$answer
 
274
if [ ! -d $ebdir ]
 
275
then
 
276
mkdir $ebdir
 
277
fi
 
278
if [ ! -d $ebdir ]
 
279
then
 
280
echo "$ebdir is not a directory"
 
281
exit 1
 
282
fi
 
283
echo
 
284
 
 
285
echo "It is convenient to have a file of bookmarks, also known as favorites
 
286
in the Windows world.
 
287
It isn't strictly necessary, but if you have this set up,
 
288
I can create some aliases and functions that will make it easier
 
289
to access, and add to, your bookmarks."
 
290
question="Enter the location of your bookmarks file"
 
291
defans=$ebdir/bookmarks
 
292
response
 
293
ebbm=$answer
 
294
touch $ebbm
 
295
if [ ! -s $ebbm ]
 
296
then
 
297
echo "<html>
 
298
<!-- Bookmark file, compatible with edbrowse.
 
299
A bookmark typically consists of 3 lines.
 
300
    URL
 
301
    description
 
302
    close anchor
 
303
This is created by the A command.
 
304
Of course this file can be viewed by any browser.
 
305
It's just html.
 
306
-->
 
307
 
 
308
<A HREF=http://www.eklhad.net>
 
309
Karl Dahlke home page
 
310
</A>
 
311
<A HREF=http://www.mathreference.com>
 
312
MathReference.com
 
313
</A>
 
314
<A HREF=http://www.space.com>
 
315
space.com
 
316
</A>" > $ebbm
 
317
fi
 
318
echo
 
319
 
 
320
#  put bookmark variables in the shell files?
 
321
bmvar=n
 
322
 
 
323
if [ $shellknown = y ]
 
324
then
 
325
echo "I can create, in your $shellstart file, a variable like this:
 
326
export bookmarks=$ebbm
 
327
so you can access your bookmarks from anywhere.
 
328
I can also put an alias in your $shellfns file
 
329
alias ebm='edbrowse \$bookmarks'
 
330
so you can type in ebm and edet or access your bookmarks from anywhere.
 
331
(You will need to log out and log back in for this alias to take effect.)"
 
332
question="Would you like me to create this alias"
 
333
defans=y
 
334
responseyn
 
335
bmvar=$answer
 
336
echo
 
337
fi
 
338
 
 
339
echo "I will create, in your config file, a function wbm that you can invoke via
 
340
<wbm
 
341
This will add the contents of your current buffer to your bookmarks.
 
342
Usually this follows the A command, which builds your bookmark.
 
343
Check it out in your config file when this program is over."
 
344
hitreturn
 
345
echo
 
346
 
 
347
echo "It is convenient to have a file of email addresses,
 
348
i.e. your address book.
 
349
It isn't strictly necessary, but if you have this set up,
 
350
I can create some aliases and functions that will make it easier
 
351
to access, and add to, your address book."
 
352
question="Enter the location of your address book"
 
353
defans=$ebdir/adbook
 
354
response
 
355
ebad=$answer
 
356
touch $ebad
 
357
if [ ! -s $ebad ]
 
358
then
 
359
echo "#  Address book, compatible with edbrowse.
 
360
 
 
361
#  relatives
 
362
 
 
363
#friends
 
364
 
 
365
#  work
 
366
 
 
367
#  internet contacts
 
368
eklhad:eklhad@gmail.com:home phone:cell phone:anything else you like
 
369
" > $ebad
 
370
fi
 
371
echo
 
372
 
 
373
#  put address book variables in the shell files?
 
374
advar=n
 
375
 
 
376
if [ $shellknown = y ]
 
377
then
 
378
echo "I can create, in your $shellstart file, a variable like this:
 
379
export adbook=$ebad
 
380
so you can access your address book from anywhere.
 
381
I can also put an alias in your $shellfns file
 
382
alias eab='edbrowse \$adbook'
 
383
so you can type in eab and edet or access your email addresses from anywhere.
 
384
(You will need to log out and log back in for this alias to take effect.)"
 
385
question="Would you like me to create this alias"
 
386
defans=y
 
387
responseyn
 
388
advar=$answer
 
389
echo
 
390
fi
 
391
 
 
392
echo "I need a file for cookies.
 
393
If you don't know what cookies are, don't worry about it.
 
394
It's just something I need to browse certain websites."
 
395
question="Enter the location of your cookie jar"
 
396
defans=$ebdir/cookies
 
397
response
 
398
ebcook=$answer
 
399
touch $ebcook
 
400
#  Some cookies contain passwords.
 
401
chmod 600 $ebcook
 
402
echo
 
403
 
 
404
echo "I need a file for secure certificates.
 
405
These are used for secure transactions on the web, such as amazon.com."
 
406
lynxcert=/etc/ssl/cert.pem
 
407
ebcert=
 
408
if [ -f $lynxcert ]
 
409
then
 
410
echo "I see you already have such a file, $lynxcert,
 
411
which is used by lynx.
 
412
Would you like edbrowse to use the same file,
 
413
so that lynx and edbrowse share the same certificates?"
 
414
question="Share with $lynxcert"
 
415
defans=y
 
416
responseyn
 
417
if [ $answer = y ]
 
418
then
 
419
ebcert=$lynxcert
 
420
fi
 
421
fi
 
422
 
 
423
if [ -z "$ebcert" ]
 
424
then
 
425
question="Enter the location of your certificate file"
 
426
defans=$ebdir/cert
 
427
response
 
428
ebcert=$answer
 
429
touch $ebcert
 
430
 
 
431
if [ ! -s $ebcert ]
 
432
then
 
433
echo "Would you like me to retrieve a file of certificates from the internet?
 
434
You must be on line for this to work."
 
435
question="Fetch from internet"
 
436
defans=y
 
437
responseyn
 
438
if [ $answer = y ]
 
439
then
 
440
wget -q -O $ebcert http://www.eklhad.net/linux/app/ssl-certs
 
441
echo "got it."
 
442
else
 
443
echo "Ok, you can get a certificate file later."
 
444
fi
 
445
fi
 
446
echo "Later on, when you are logged in as root, you may want to move this
 
447
to $lynxcert, so that your certificates can be shared among
 
448
edbrowse, lynx, and other browsers."
 
449
fi
 
450
echo
 
451
 
 
452
echo "I need a file to store IP addresses that usually generate spam.
 
453
This file can be empty for now; as long as it exists.
 
454
We'll worry about how to populate it later."
 
455
question="List of suspect IP addresses"
 
456
defans=$ebdir/ipblack
 
457
response
 
458
ebip=$answer
 
459
touch $ebip
 
460
echo
 
461
 
 
462
echo "When edbrowse fetches your mail, it automatically moves to a directory
 
463
that you can think of as your in-box."
 
464
question="Enter mail directory"
 
465
defans=$HOME/mbox
 
466
response
 
467
ebinbox=$answer
 
468
if [ ! -d $ebinbox ]
 
469
then
 
470
mkdir $ebinbox
 
471
fi
 
472
echo
 
473
 
 
474
if [ $shellknown = y ]
 
475
then
 
476
#  It's really stupid that bash doesn't call .bashrc after invoking .bash_login.
 
477
#  So you should call .bashrc from insinde .bash_login.
 
478
#  Do you?
 
479
callbashrc=n
 
480
if grep -q "^\. *$shellfns" $shellstart
 
481
then
 
482
callbashrc=y
 
483
fi
 
484
fi
 
485
 
 
486
if [ $bmvar = y ]
 
487
then
 
488
echo "
 
489
export bookmarks=$ebbm" >> $shellstart
 
490
echo "
 
491
alias ebm='edbrowse $ebbm'" >> $shellfns
 
492
if [ $callbashrc = n ]
 
493
then
 
494
echo "
 
495
alias ebm='edbrowse $ebbm'" >> $shellstart
 
496
fi
 
497
fi
 
498
 
 
499
if [ $advar = y ]
 
500
then
 
501
echo "
 
502
export adbook=$ebad" >> $shellstart
 
503
echo "
 
504
alias eab='edbrowse $ebad'" >> $shellfns
 
505
if [ $callbashrc = n ]
 
506
then
 
507
echo "
 
508
alias eab='edbrowse $ebad'" >> $shellstart
 
509
fi
 
510
fi
 
511
 
 
512
echo "#  My address book.
 
513
adbook = $ebad
 
514
 
 
515
#  The cookie jar
 
516
jar = $ebcook
 
517
 
 
518
#  secure certificates for https
 
519
certfile = $ebcert
 
520
 
 
521
#  ip addresses in the blacklist
 
522
ipblack = $ebip
 
523
 
 
524
#  Write spam messages here.  I use a file in my trash bin,
 
525
#  so I know it gets cleaned out every week.
 
526
spamcan = $HOME/.Trash/spamcan
 
527
 
 
528
#  Function to write a bookmark to your list of favorites.
 
529
#  Best to use this function every time, because it appends.
 
530
#  If you do it manually you might accidentally write without append,
 
531
#  and clobber all the bookmarks you have accumulated.
 
532
function+wbm {
 
533
w+ $ebbm
 
534
}
 
535
 
 
536
#  Move to this directory when fetching mail.
 
537
maildir = $ebinbox
 
538
 
 
539
#  autosetup 3" >> $ebcf
 
540
 
 
541
level=3
 
542
fi
 
543
 
 
544
if [ $level = 3 ]
 
545
then
 
546
echo "*** level 3, mail accounts ***
 
547
 
 
548
It's time to configure your mail accounts,
 
549
so that edbrowse can act as a mail client, retrieving and sending mail
 
550
over the Internet.  I only need to know about direct mail accounts.
 
551
If you have a mail account, such as hotmail.com, that you access
 
552
through your browser, as a website, I don't need to know about that.
 
553
I only need to know about mail accounts that you access through a mail client
 
554
like Outlook, Pine, Eudora, etc."
 
555
question="Do you have any of these mail accounts"
 
556
defans=y
 
557
responseyn
 
558
echo
 
559
 
 
560
#  Build the mail string as we go.
 
561
#  I'll turn & into newline later.
 
562
mst="#  Mail accounts.&#  These are the direct mail accounts, web based email is not needed here.&"
 
563
 
 
564
if [ $answer = n ]
 
565
then
 
566
mst="$mst&#  No mail accounts at the present time.&"
 
567
 
 
568
else
 
569
 
 
570
echo "Great.  Here is what you will need for each mail account.
 
571
1. The machine that you get your mail from, and send your mail to.
 
572
These are often the same machine, such as mail.somedomain.com,
 
573
but sometimes they are different, such as pop3.somedomain.com
 
574
and smtp.somedomain.com.
 
575
2. Whether these connections are secure/encrypted.
 
576
Local mail, offered by your ISP, is usually not.
 
577
Distant mail, such as Google mail, usually is, since your personal email
 
578
travels across the Internet to get to and from the server.
 
579
3. Your email address relative to this account.
 
580
This takes the form: username@somedomain.com.
 
581
4. Login, usually the same as username.
 
582
5. Password.  This is the secret that keeps others from accessing your mail.
 
583
6. Full name.  This appears in your emails.
 
584
Of course you know what your name is, but you may want different names
 
585
for different accounts.
 
586
Home account, work account, your child's account, etc.
 
587
So I give you the chance to enter a different name with each account.
 
588
You need all this information at hand, for each account, before we proceed."
 
589
hitreturn
 
590
echo
 
591
 
 
592
mailnum=1
 
593
 
 
594
fullname=
 
595
while true
 
596
do
 
597
if [ $mailnum = 1 ]
 
598
then
 
599
echo "Enter your first mail account.
 
600
This should be the primary account, the one offered by your ISP.
 
601
For technical reasons, this will become the default account.
 
602
If you just type sm, without specifying an account,
 
603
I will use this account to send your mail."
 
604
hitreturn
 
605
echo
 
606
else
 
607
question="Do you have another mail account"
 
608
defans=n
 
609
responseyn
 
610
echo
 
611
if [ $answer = n ]
 
612
then
 
613
break
 
614
fi
 
615
fi
 
616
 
 
617
echo "Enter the email address.
 
618
This looks like user@somedomain.com."
 
619
question="Email address"
 
620
defans=
 
621
response
 
622
reply=$answer
 
623
user=${answer/@*/}
 
624
domain=${answer/*@/}
 
625
 
 
626
question="Enter user name"
 
627
defans=$user
 
628
response
 
629
user=$answer
 
630
 
 
631
question="Enter password"
 
632
defans=
 
633
response
 
634
password=$answer
 
635
 
 
636
question="Enter the full name associated with this account"
 
637
defans=$fullname
 
638
response
 
639
fullname=$answer
 
640
 
 
641
question="Enter the machine where you get your mail"
 
642
defans="mail.$domain"
 
643
response
 
644
pop=$answer
 
645
 
 
646
question="Enter the machine where you send your mail"
 
647
defans=$pop
 
648
defans=${defans/#pop3./smtp.}
 
649
defans=${defans/#pop./smtp.}
 
650
response
 
651
smtp=$answer
 
652
 
 
653
question="Is this a secure/encrypted connection"
 
654
defans=n
 
655
responseyn
 
656
secure=$answer
 
657
 
 
658
mst="$mst&mail {&inserver = $pop&outserver = $smtp"
 
659
if [ $mailnum = 1 ]
 
660
then
 
661
mst="$mst&default"
 
662
fi
 
663
if [ $secure = y ]
 
664
then
 
665
mst="$mst&inport = *995&outport = *465"
 
666
else
 
667
mst="$mst&inport = 110&outport = 25"
 
668
fi
 
669
mst="$mst&login = $user&password = $password&from = $fullname&reply = $reply&}&"
 
670
 
 
671
echo "You may want to create an alias for convenient access to this account.
 
672
alias whatevermail='edbrowse -m$mailnum'
 
673
I'll leave that to you.
 
674
"
 
675
mailnum=$((mailnum+1))
 
676
done
 
677
 
 
678
fi
 
679
 
 
680
echo "$mst&#  autosetup 4" |
 
681
tr '&' '\12' >> $ebcf
 
682
 
 
683
level=4
 
684
fi
 
685
 
 
686
if [ $level = 4 ]
 
687
then
 
688
echo "*** level 4, filters ***
 
689
 
 
690
I will place a from filter block in your config file.
 
691
This directs email from certain people, by name or by email address,
 
692
into certain files.
 
693
I'm only creating the fromfilter { } block at this time.
 
694
You can edit your config file and fill in the details later.
 
695
Remember that every line in your address book becomes its own from filter,
 
696
so you don't have to duplicate all those entries.  For instance,
 
697
fred:fred.flintstone@cartoons.com
 
698
will save any message from fred.flintstone@cartoons.com to a file called fred.
 
699
But Fred might have a work email down at the Cave Construction Company,
 
700
so you might want to filter him by name as well.
 
701
    Fred Flintstone > fred
 
702
I will add an entry for myself, by name, in case you get email from me
 
703
in the future, from any of my numerous email accounts.
 
704
    Karl Dahlke > eklhad
 
705
That will be the only entry in your fromfilter block, for now."
 
706
hitreturn
 
707
echo
 
708
 
 
709
echo "I will create a subject filter block, which saves emails into files
 
710
based on subject, and a to filter block, which saves emails into files
 
711
based on the email address it was sent to.
 
712
Again, these blocks will be empty."
 
713
hitreturn
 
714
echo
 
715
 
 
716
echo "I will create a last spamm function, <lspam, that will retrieve the last
 
717
message that was placed in your spam area.
 
718
Similarly, <bspam steps back to the previous spam message, and so on.
 
719
You should really review your spam emails, because my source IP
 
720
test is really quite crude, and there are plenty of false positives."
 
721
hitreturn
 
722
echo
 
723
 
 
724
echo "#  to, from, and subject filters
 
725
 
 
726
tofilter {
 
727
}
 
728
 
 
729
fromfilter {
 
730
Karl Dahlke > eklhad
 
731
}
 
732
 
 
733
subjfilter {
 
734
}
 
735
 
 
736
#  Function to read the last spam message.
 
737
function+lspam {
 
738
e /home/eklhad/.Trash/spamcan
 
739
?={70}?+,\$w2
 
740
e2
 
741
b
 
742
1z20
 
743
}
 
744
 
 
745
#  Back up to the previous spam message.
 
746
function +bspam {
 
747
e1
 
748
?={70}?X
 
749
-kb
 
750
?={70}?X
 
751
+s/^[RD]/&/
 
752
.,'bw2
 
753
e2
 
754
b
 
755
1z20
 
756
}
 
757
 
 
758
#  Sometimes javascript does nothing more than deliver advertisements,
 
759
#  and edbrowse javascript is not the greatest,
 
760
#  so turn it off for certain domains.
 
761
nojs = space.com
 
762
 
 
763
#  autosetup 5" >> $ebcf
 
764
 
 
765
level=5
 
766
fi
 
767
 
 
768
if [ $level = 5 ]
 
769
then
 
770
echo "*** level 5, audio files ***
 
771
 
 
772
Enter the program, with parameters, that plays wave, voc, and audio files."
 
773
playloc=`whereis -b play`
 
774
playloc=${playloc/#play:/}
 
775
playloc=${playloc/# /}
 
776
if [ -n "$playloc" ]
 
777
then
 
778
echo "Audio player found in $playloc,
 
779
but you can use another player if you wish."
 
780
defans="play -t * -"
 
781
else
 
782
echo "Leave blank if you have no player installed."
 
783
defans=
 
784
fi
 
785
question="Audio player"
 
786
response
 
787
playprog=$answer
 
788
echo
 
789
 
 
790
echo "Enter the program, with parameters, that plays mp3 files."
 
791
mpgloc=`whereis -b mpg123`
 
792
mpgloc=${mpgloc/#mpg123:/}
 
793
mpgloc=${mpgloc/# /}
 
794
if [ -n "$mpgloc" ]
 
795
then
 
796
echo "MP3 player found in $mpgloc,
 
797
but you can use another player if you wish."
 
798
defans="mpg123 -q -"
 
799
else
 
800
echo "Leave blank if you have no mp3 player installed."
 
801
defans=
 
802
fi
 
803
question="MP3 player"
 
804
response
 
805
mpgprog=$answer
 
806
echo
 
807
 
 
808
echo "Enter the program, with parameters, that plays streaming audio.
 
809
This is RealPlayer audio, not Windows Media or Quicktime;
 
810
those are not supported yet."
 
811
trloc=`whereis -b trplayer`
 
812
trloc=${trloc/#trplayer:/}
 
813
trloc=${trloc/# /}
 
814
if [ -n "$trloc" ]
 
815
then
 
816
echo "Streaming audio player found in $trloc,
 
817
but you can use another player if you wish."
 
818
defans="trplayer"
 
819
else
 
820
echo "Leave blank if you have no streaming audio player installed."
 
821
defans=
 
822
fi
 
823
question="Streaming audio player"
 
824
response
 
825
trprog=$answer
 
826
echo
 
827
 
 
828
(
 
829
echo "#  Describe the mime types and the programs to run them.
 
830
"
 
831
 
 
832
if [ -n "$playprog" ]
 
833
then
 
834
echo "mime {
 
835
type = audio/basic
 
836
desc = audio file in a wave format
 
837
suffix = wav,voc,au
 
838
#  The star is replaced with the suffix at runtime
 
839
program = $playprog
 
840
}
 
841
"
 
842
fi
 
843
 
 
844
if [ -n "$mpgprog" ]
 
845
then
 
846
echo "mime {
 
847
type = audio/mp3
 
848
desc = audio file in mp3 format
 
849
suffix = mp3
 
850
program = $mpgprog
 
851
}
 
852
"
 
853
fi
 
854
 
 
855
if [ -n "$trprog" ]
 
856
then
 
857
echo "mime {
 
858
#  the < forces it to be a stream, hence the url is passed to the program
 
859
type = <audio/x-pn-realaudio
 
860
desc = streaming audio real player
 
861
suffix = rm,ra,ram
 
862
protocol = rtsp,pnm
 
863
program = $trprog
 
864
}
 
865
"
 
866
fi
 
867
 
 
868
echo "#  autosetup 6"
 
869
) >> $ebcf
 
870
 
 
871
level=6
 
872
fi
 
873
 
 
874
if [ $level = 6 ]
 
875
then
 
876
echo "*** level 6, sample functions ***
 
877
 
 
878
Perhaps the two most useful sites on the Internet are google and wikipedia.
 
879
I will create two functions that make it easy to access these sites.
 
880
They are similar to shortcuts in the desktop world.
 
881
To search for kangaroo in google, type <gg kangaroo.
 
882
To search for kangaroo in wikipedia, type <wk kangaroo.
 
883
These functions will also show you, by example,
 
884
how to write your own functions with parameters etc.
 
885
Please review your config file and look for the functions gg and wk."
 
886
hitreturn
 
887
echo
 
888
 
 
889
cat <<'!' >>$ebcf
 
890
#  User defined functions, macros, and shortcuts.
 
891
 
 
892
#  Access wikipedia
 
893
function+wk {
 
894
b http://www.wikipedia.org/search-redirect.php?search=~0&language=en&go=%3E&go=Go
 
895
}
 
896
 
 
897
#  Access google
 
898
function+gg {
 
899
b www.google.com/search?q=~0&hl=n&btnG=Google+Search&meta=
 
900
#  invoke the google cleanup routine
 
901
<ggc
 
902
}
 
903
 
 
904
#  strip the trash off of a google page.
 
905
#  This can become out of date if google changes its page layout.
 
906
function:ggc {
 
907
#  get rid of pdf warnings
 
908
g/^Your browser may not have a PDF reader available.$/d
 
909
g/^{Similar pages}$/d
 
910
#  trailing lines, after "search next", can go away
 
911
/^{search Next}$/+,$d
 
912
#  initial lines and stats can go away
 
913
1,/seconds)$/d
 
914
#  move the "did you mean" line to the end; we need to keep this one
 
915
/^Did you mean:$/,/^Did you mean:$/+2m$
 
916
#  more stuff at the start that we don't need
 
917
1,/^Tip: Save time by hitting/+d
 
918
#  put the "did you mean" line back to the top, if it's there
 
919
/^Did you mean:$/,$m0
 
920
}
 
921
 
 
922
!
 
923
 
 
924
#  Get rid of the autosetup lines.
 
925
ed $ebcf <<! >/dev/null 2>&1
 
926
g/^#  autosetup [0-9]$/d
 
927
w
 
928
q
 
929
!
 
930
 
 
931
echo "Congratulations, your config file $ebcf is complete."
 
932
 
 
933
fi
 
934
 
 
935
exit 0