TIP: Click on subject to list as thread! ANSI
echo: elebbs_support
to: All
from: Drew Baker
date: 2006-07-21 19:18:20
subject: EleBBS: Updated Linux/Dos EMU/door script

* EleBBS Support List

Here is the bash script I use to run all my dosemu and other doors.
Every single door runs via this script. If people have questions about
dos setup I would be happy to give advice.



#!/bin/sh
##execute.sh version 1.34  7_21_06
##See bottom of script for change logs.

#Define the locations of your files DO NOT INCLUDE TRAILING SLASH /
clear
NODEDIR=/home/bbs/node
BBSDIR=/home/bbs
SCRIPTDIR=/home/bbs/dos_scripts
DOSEMUDIR=/home/bbs/dosemu/freedos
SUBDIR=/home/bbs/subhome

clear

if [ "$4" == "" ]
	then
	echo "Configured as"
	echo "nodedir="$NODEDIR
	echo "bbsdir="$BBSDIR
	echo "scriptdir="$SCRIPTDIR
	echo "dosemudir="$DOSEMUDIR
	echo "subdir="$SUBDIR
	echo ""
	echo "No commands passed to execute.sh. Please read Required Variables"
	echo ""
	echo "format   execute.sh node% user% execute% mode%"
	echo "example  execute.sh 1 drewbaker TW2002 DOSEMU"
	echo ""
	echo "Will run script TW2002 in DOSEMU as user drewbaker on node 1"
	sleep 3
	exit

fi

#Sets Terminal display to be compatable with industry standards. If user is
#running native linux applications and connecting via SSH this will have no
#effect. Display will be set to terminal on client side.
stty columns 80 line 25


#VARIABLES REQUIRED TO BE PASSED
#execute.sh NODE% USER% EXECUTE% MODE%
# NODE = BBS NODE Number If not needed place a '1' here
# USER = USER, this is the full account name on BBS. Used in handling
home directory and drop file creation
# EXECUTE = Bash script to execute after script converts users. OR
DOSLAUNCH Variable to pass onto emulator
# MODE = What mode to operate in. Valid modes
#	NATIVE = No special changes needed. Linux file may be launched
without specifying home
#	HOMDIR = Creates, manages and uses virtual home directory
#	TARDIR = Same as HOMDIR, only stores files in compress tarball,
Usefull for large homedir's
#	DOSEMU = Pass and launch clasic dos application.
#	DOSSRV = Pass and launch clasic dos application as background
service (tradewar alien AI engine).
#	DOSDUM = Pass and launch in dumb terminal dos. (linux shell remains
loaded while dos executes in background)
#	DOSPAS = Pass and launch in dos. (no door,node, user info is passed)
All scripts and batch files much be handled internaly in dosemu,
example would be to run nightly events like tradewars extern

clear
#remove reset if display gets messed up when returning to bbs.
#reset

echo "Launcher for Non-Multi-Node Doors Version 1.34 By Andrew Baker"
echo "Loading Personalized Home Directory for $2 on Node $1 running $3"
echo ""
echo ""
sleep 1

if [ -d "$SUBDIR/$2" ]
	then
		echo "The Sub home directory $2 Exists"

	else
		echo "The Sub home directory $2 does not exist. Either this is your
first visit to StarDoc 134 doors, or you have not visited the doors
within 90 days. A New account may be created for you."
					echo "Creating your home"
					mkdir $SUBDIR/$2
					sleep 2
fi	

if [ "$4" == "SHOWHOME" ]
	then
		ls $SUBDIR/$2 | more
		echo ""
		echo "Please wait"
		sleep 10
fi

if [ "$4" == "HOMDIR" ]
	then
	USER=$2_STARDOC134
	HOME=$SUBDIR/$2
	echo "Restoring Files (this may take a moment)"
	cp $SUBDIR/$2/* $NODEDIR$1/
	$SCRIPTDIR/$3
	echo "Backing up your files"
	cp $NODEDIR$1/* $SUBDIR/$2/
	rm $SUBDIR/$2/*.sys 2> /dev/null
	rm $SUBDIR/$2/*.def 2> /dev/null
	#rm $SUBDIR/$2/*.bbs 2> /dev/null
	rm $SUBDIR/$2/*.jdt 2> /dev/null
	rm $SUBDIR/$2/*.jdx 2> /dev/null
	rm $SUBDIR/$2/*.jhr 2> /dev/null
	rm $SUBDIR/$2/*.jlr 2> /dev/null
	rm $SUBDIR/$2/*.jir 2> /dev/null
	rm $NODEDIR$1/* 2>/dev/null
	cp $SUBDIR/$2/exitinfo.bbs $NODEDIR$1/exitinfo.bbs 2> /dev/null
	HOME=$BBSDIR
	USER=BBS
fi


if [ "$4" == "TARDIR" ]
	then
	echo "NOT DEVELOPED YET, USE HOMDIR FOR NOW"
fi

if [ "$4" == "NATIVE" ]	
	then
	$SCRIPTDIR/$3 $1 $2
fi


if [ "$4" == "DOSEMU" ]
	then

	#script assumes bbs is located in $BBSDIR  you will need to adjust scripts if
	#located elseware.
	#reset users terminal for 80x25, this will pervent dosemu from crashing,
	#or causing problems
	stty columns 80 line 25

	#Display a wait screen for user. When bbs us under high load, dosemu may take
	#20-30 seconds to load
	echo "Please Wait.  System is loading Legacy emulators. This may take
a minute"

	#copies node information to the dosemu enviornment. The C drive in dos
	cp $NODEDIR$1/ $DOSEMUDIR/ -R

	#This creates a files that will be excecuted in the autoexec within
the dos box enviornment
	#I know it says tradewars that was just my first program to get
running. The variables
	#apply to all programs
	echo "Rem TradeWars 2002 Operating Transfer Config" >
$DOSEMUDIR/lovar.bat
	echo "SET NODE="$1 >> $DOSEMUDIR/lovar.bat
	echo "SET TWUSER="$2 >> $DOSEMUDIR/lovar.bat
	echo "SET DOOR="$3 >> $DOSEMUDIR/lovar.bat

	#launches dosemu. Notice that there are no variables passed directly to dos emu
	#all variables needed are stored in the above echo.
	dosemu

	#Cleans up temporary files used durring door usage
	rm $DOSEMUDIR/node$1 -R

	#Resets display
	#reset -m network:vt100

fi



if [ "$4" == "DOSDUM" ]
	then
	echo "Rem TradeWars 2002 Operating Transfer Config" >
$DOSEMUDIR/lovar.bat
	echo "Rem SET TWNODE="$1 >> $DOSEMUDIR/lovar.bat
	echo "SET TWUSER="$2 >> $DOSEMUDIR/lovar.bat
	echo "SET DOOR="$3 >> $DOSEMUDIR/lovar.bat
	dosemu -d $3
fi



if [ "$4" == "DOSPAS" ]
	then
	dosemu $3
fi




#CHANGE LOG
#v1.34
#
#Fixed error were home data of two users would be confused if more then
#one user used same program. User 1 loads program1, user 2 logs on and
#also uses program1. user 2 logs off, his data is saved, however when user 1
#quits, he would get user 2s data.
#
#v1.33
#Fixed glitch that caused some games to misread unix formated text files
#
#v1.32
#Added comments to popular sections
#
#v1.31
#Cleanup un-needed code
#
#v1.30
#Added variables to allow porting to other bbs's
#
#v1.20
#Official release to public.
#v1.0+
#private script for own use.





-- 
Beware the jaws that bite, for they belong to my evil attack penguin.

Open Source Software, Not only a way of life, but a tasty desert as
well.  http://www.fosug.org

Bring back the days of the BBS:  Telnet/SSH2:/doteltech.com
_______________________________________________________________


--- Internet Rex 2.29
* Origin: The gateway at The Snake (2:280/4312.101)
SEEN-BY: 633/267 270
@PATH: 280/4312 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.