2002-02-23 20:28:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# Hatch script for MBSE BBS.
|
|
|
|
#
|
|
|
|
#============================================================================
|
2008-03-04 20:40:19 +00:00
|
|
|
# Copyright (C) 1997-2008
|
2002-02-23 20:28:36 +00:00
|
|
|
#
|
|
|
|
# Michiel Broek FIDO: 2:280/2802
|
|
|
|
# Beekmansbos 10
|
|
|
|
# 1971 BV IJmuiden
|
|
|
|
# the Netherlands
|
|
|
|
#
|
|
|
|
# This file is part of MBSE BBS.
|
|
|
|
#
|
|
|
|
# This BBS is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License as published by the
|
|
|
|
# Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
# later version.
|
|
|
|
#
|
|
|
|
# MBSE BBS is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with MBSE BBS; see the file COPYING. If not, write to the Free
|
2003-08-15 20:05:34 +00:00
|
|
|
# Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
2002-02-23 20:28:36 +00:00
|
|
|
#============================================================================
|
|
|
|
#
|
|
|
|
# Global settings, change as needed:
|
|
|
|
#
|
2004-01-21 20:32:00 +00:00
|
|
|
# Password, see menu 1.10.2
|
2002-02-23 20:28:36 +00:00
|
|
|
#
|
|
|
|
HATCHPWD="DizIzMyBIGseeKret"
|
|
|
|
INBOUND=$MBSE_ROOT/var/inbound
|
2008-03-04 20:40:19 +00:00
|
|
|
HVERSION="1.0.3"
|
2002-02-23 20:28:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
if [ "`id -un`" != "mbse" ]; then
|
|
|
|
echo "This program may only be used by user 'mbse'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2004-01-21 20:32:00 +00:00
|
|
|
if [ "DizIzMyBIGseeKret" == "${HATCHPWD}" ]; then
|
|
|
|
echo "This script is not yet configured, first edit this script before use!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-02-23 20:28:36 +00:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
Hatch files for MBSE BBS. All files you want to hatch must be
|
|
|
|
in the current directory and must be owned by user 'mbse' and
|
|
|
|
group 'bbs'. They will be removed when they are hatched, so
|
|
|
|
this should be a temporary copy of all those files.
|
|
|
|
These files must be real files, no symlinks.
|
2002-03-02 21:25:12 +00:00
|
|
|
Long filenames are allowed as long as there are no spaces in
|
|
|
|
the filename. The mbfido program will build the 8.3 filenames
|
|
|
|
when needed.
|
|
|
|
When hatching long filenames and downlinks complain about this,
|
|
|
|
then with mbsetup set these nodes to 8.3 names.
|
2002-02-23 20:28:36 +00:00
|
|
|
|
|
|
|
EOF
|
2002-03-02 21:25:12 +00:00
|
|
|
|
|
|
|
echo -n "Enter TIC group to hatch files in (Control-C = stop) : "
|
2002-02-23 20:28:36 +00:00
|
|
|
read GROUP
|
2002-03-02 21:25:12 +00:00
|
|
|
if [ -z "$GROUP" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -n "Enter the Fidonet aka for this TIC group, ie. 2:280/2802 : "
|
2002-02-23 20:28:36 +00:00
|
|
|
read AKA
|
2002-03-02 21:25:12 +00:00
|
|
|
if [ -z "$AKA" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2002-02-23 20:28:36 +00:00
|
|
|
echo -e "Now scanning directory, add a oneline description for each file\n"
|
|
|
|
|
|
|
|
i=0;
|
|
|
|
for f in `ls`
|
|
|
|
do
|
|
|
|
if [ -f $f ]; then
|
|
|
|
echo -e "Enter description for $f (empty is skip file)"
|
|
|
|
echo -n ": "
|
|
|
|
read DESC
|
|
|
|
if [ ! -z "$DESC" ]; then
|
2004-01-21 20:32:00 +00:00
|
|
|
echo -e "Replace filename (empty is none)"
|
|
|
|
echo -n ": "
|
|
|
|
read REPL
|
|
|
|
echo -e "Magic filename (empty is no magic)"
|
|
|
|
echo -n ": "
|
|
|
|
read MAGIC
|
2002-02-23 20:28:36 +00:00
|
|
|
let i=i+1
|
|
|
|
FILE=$INBOUND/`$MBSE_ROOT/bin/mbseq`.tic
|
|
|
|
echo "Hatch" > $FILE
|
2002-10-28 13:57:38 +00:00
|
|
|
echo "Created MBSE BBS hatch script v$HVERSION" >> $FILE
|
2002-02-23 20:28:36 +00:00
|
|
|
echo "Area $GROUP" >> $FILE
|
2002-10-28 13:57:38 +00:00
|
|
|
if [ ! -z "$REPL" ]; then
|
|
|
|
echo "Replaces $REPL" >> $FILE
|
|
|
|
fi
|
|
|
|
if [ ! -z "$MAGIC" ]; then
|
|
|
|
echo "Magic $MAGIC" >> $FILE
|
|
|
|
fi
|
2002-02-23 20:28:36 +00:00
|
|
|
echo "Origin $AKA" >> $FILE
|
|
|
|
echo "From $AKA" >> $FILE
|
2008-03-04 20:40:19 +00:00
|
|
|
echo "File $f" >> $FILE
|
2002-02-23 20:28:36 +00:00
|
|
|
echo "Fullname $f" >> $FILE
|
|
|
|
echo "Pth `pwd`" >> $FILE
|
|
|
|
echo "Desc $DESC" >> $FILE
|
|
|
|
echo "Pw $HATCHPWD" >> $FILE
|
|
|
|
echo -e "\nFile hatched\n"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo -e "\nTotal $i files hatched in area $GROUP."
|
|
|
|
echo "Start processing TIC files"
|
|
|
|
|
|
|
|
$MBSE_ROOT/bin/mbfido tic
|
|
|
|
|