This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-mbse/script/editor.in

100 lines
2.3 KiB
Plaintext
Raw Normal View History

2002-03-06 22:37:01 +00:00
#!/bin/bash
#
# $Id$
#
# Script to start joe editor as external editor for MBSE BBS
# Written by Redy Rodriguez.
### Function to kill the editor when no time left
function alarma
{
sleep $1m
killall $2 >/dev/null 2>&1
}
## Set term environmment
export JOETERM=ansi.sys
## Read variables from data.msg
. ~/data.msg
## Read time left from door.sys
TIME=`head -n19 ~/door.sys |tail -n1 |tr -d "[:cntrl:]"`
## Set preferred editor and parameters
2002-07-27 20:15:07 +00:00
EDITOR=@joebin@/bbsjoe
2002-03-06 22:37:01 +00:00
PARAM="~/edit.msg"
# Using joe with emacs keys:
# You can make a bbsjmacsrc file with emacs keys and put it
# in /usr/lib/joe, and then a symlink to joe called bbsjmacs
# in /usr/bin (dirs can change in other distros), and then
# uncomment next line. If user select Emacs keys then this
# editor was selected.
2004-08-18 15:22:11 +00:00
if [ "BBSFSEDKEYS" = "1" ]; then EDITOR=@joebin@/bbsjmacs; fi
2002-03-06 22:37:01 +00:00
## Setting Language environmment for msg header
case $BBSLANGUAGE in
## Spanish
S)
LANGAREA='AREA'
LANGFROM='De '
LANGTO='Para '
LANGRE='Asunto '
;;
## Galician
G)
LANGAREA='AREA'
LANGFROM='De '
LANGTO='Para '
LANGRE='Asunto '
;;
## Italian
I)
LANGAREA='AREA'
LANGFROM='Da '
LANGTO='A '
LANGRE='Oggetto '
;;
## German
D)
LANGAREA='BEREICH'
LANGFROM='Von '
LANGTO='An '
LANGRE='Betreff '
;;
## Dutch
N)
2004-08-18 15:22:11 +00:00
LANGAREA='GEBIED'
2002-03-06 22:37:01 +00:00
LANGFROM='Van '
LANGTO='Aan '
LANGRE='Onderwerp'
;;
## Languages not set defaults to english.
2002-03-12 22:09:05 +00:00
*)
2002-03-06 22:37:01 +00:00
LANGAREA='AREA'
2004-08-18 15:22:11 +00:00
LANGFROM='From '
LANGTO='To '
LANGRE='Subject '
2002-03-06 22:37:01 +00:00
;;
esac
## Set Alarm to kill editor when no time left
alarma $TIME $EDITOR &
## Draw header and call editor
clear
2004-08-18 15:22:11 +00:00
echo -e "
2004-11-03 20:48:45 +00:00
$LANGAREA: $AREANUM $AREA
\n$LANGFROM: $MSGFROM $MSGFROMADDR
\n$LANGTO: $MSGTO $MSGTOADDR
\n$LANGRE: $MSGSUBJECT
2004-08-18 15:22:11 +00:00
\n"
2002-03-06 22:37:01 +00:00
$EDITOR $PARAM
## kill alarm
killall sleep >/dev/null 2>&1
clear