#!/bin/sh
# bbs.sh 
# Rev:991211

# preparation

setvar HOST  'mars.st.rim.or.jp'
setvar WEB  'http://www.st.rim.or.jp/~wackie/'
setvar site  ${HOME}/web/
setvar script  ${HOME}/script/
setvar tmp  ${site}tmp$$

# format message

  if ( test -f ${site}bbs.body ) then
    \mv ${site}bbs.body ${tmp}
  fi
  awk -f ${script}bbs.awk - | /usr/local/bin/nkf -m > ${site}bbs.body
  if ( test -f ${tmp} ) then
    cat ${tmp} >> ${site}bbs.body
    \rm ${tmp}
  fi
  cat ${site}bbs.head ${site}bbs.body ${site}bbs.tail > ${site}bbs.html


# ftp put "bbs.html" to $HOST

( echo cd public_html; echo put ${site}bbs.html bbs.html; echo quit) | ftp $HOST

# create text file for e-mail

/usr/local/bin/lynx -dump ${WEB}bbs.html | nkf -j > ${site}bbs.txt

