Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#!/bin/bash

set -e
set -x

rm -rf /tmp/setup
mkdir /tmp/setup

## Do the downloads
cd /tmp/setup
wget https://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/simtelnet/msdos/fossil/adf_150.zip
wget https://bbs.bapho.net/bbs/i-drive/generic/pkz204g.exe
wget http://cd.textfiles.com/pier/pier08/046/list91k.zip
wget http://www.filegate.net/comm/dszexe.zip

# Unpack PKZIP
mkdir /tmp/setup/t
cd /tmp/setup/t
unzip ../pkz204g.exe
mv -v PKZIP.EXE PKUNZIP.EXE PKUNZJR.COM /dos/drive_h/UTILS/
cd /tmp/setup
rm -r /tmp/setup/t

# Unpack LIST
mkdir /tmp/setup/t
cd /tmp/setup/t
unzip ../list91k.zip
mv -v LIST.COM /dos/drive_h/UTILS/
cd /tmp/setup
rm -r /tmp/setup/t

# Unpack DSZ
mkdir /tmp/setup/t
cd /tmp/setup/t
unzip ../dszexe.zip
mv -v DSZ.EXE /dos/drive_h/UTILS/
cd /tmp/setup
rm -r /tmp/setup/t

# Unpack ADF (FOSSIL)
cd /dos/drive_h
rm -rf adf
mkdir adf
cd adf
unzip /tmp/setup/adf_150.zip
rm /tmp/setup/adf_150.zip


Add startdossession script

vi /usr/local/bin/startdossession


Code Block
#!/bin/bash

# $1 - session name
set -e

if [ -z "$1" ]; then
   echo "Syntax: $0 sessionname [dosemuargs]"
   exit 1
fi

export SESSION="$1"
SESSPATH="/dos/sessions/$1"

if [ ! -e "$SESSPATH" ]; then
  cp -a /dos/session.skel "$SESSPATH"
fi

if check-dosemu-session $SESSION; then
  echo "dosemu session $SESSION already running; refusing to start again"
  exit 1
fi

HOME=/root   # telnetd may not leave this set for us
# Copy .Xauthority, since we have to set HOME
rm -rf "$SESSPATH/.Xauthority"
cp -r $HOME/.Xauthority "$SESSPATH"

# After the first start, we have to copy the drive stuff into here.
DRIVESPATH="$SESSPATH/.dosemu/drives"
if [ -e "$DRIVESPATH" ]; then
  cp -an /etc/dosemu/drives/* "$DRIVESPATH"
fi

waitfordaemon vncserver
shift

# Final sanity check.
dotlockfile -p -l "$SESSPATH/jglock"
# -f is an excuse for the session check
stty raw
DISPLAY=:1 HOME="$SESSPATH" exec dosemu -f "$SESSPATH/dosemu.conf" "$@"
dotlockfile -p -u "$SESSPATH/jglock"

chmod +x /usr/local/bin/startdossession


Add check-dosemu-session script

vi /usr/local/bin/check-dosemu-session


Code Block
#!/bin/bash

# Check if a dosemu session named "$1" is running.

# If yes, exit with code 0 and display its PID.
# If no, exit with code 1.

pgrep -f "dosemu.*/dos/sessions/$1/dosemu.conf"


chmod +x /usr/local/bin/check-dosemu-session


Add startnode script

vi /usr/local/bin/startnode

...

Trade Wars 2002

...