#!/bin/sh

# This script will Launch ZDaemon dedicated Linux Server
# And will restart it in the event of a crash.
# Type "quit" to shut the server down then
# ctrl-c to completly stop it.
# To restart the server just type "quit" then wait 10 
# seconds and it will reload.
# Slayer1 http://www.doom2.org 




####################################
# Edit these if you need to.       #
####################################                   
# User Defined Variables           #
#################################################################
IWAD=                              # iwad you want to use       #
PWAD=                              # pwad you want to use       #
PWAD2=                             # pwad2 you want to set      #
PORT=10666                         # port you want to use       #
SKIN=skins/zskins.wad              # skin wads                  #
#SKIN2=skins/xxlfrag.wad           # skin wads                  # 
#CFG=slayer.cfg                    # Config to execute          #
MAXCLIENTS=6                       # Max Clients allowd on srvr #
MAXPLAYERS=4                       # Max Allowed to play	#
EXE=Zserv                          # Server bianary             #
#################################################################
# End of User Variables            #
####################################
# Slayer1                          #
####################################



###########################################################
#DO NOT EDIT ANYTHING BELOW THIS LINE			  #
###########################################################                                

while [ 1 ]; do
./$EXE -file $PWAD $PWAD2 -iwad $IWAD -skin $SKIN $SKIN2 -maxclients $MAXCLIENTS -maxplayers $MAXPLAYERS +exec $CFG -port $PORT 
   echo
   echo
   echo "Hit ctrl-c NOW or wait 10 seconds for Zserv to automaticly restart"
   sleep 10
done
