+while [ $# -gt 0 ]; do
+ opt="$1"
+ shift
+ case "$opt" in
+ -h | --help )
+ cat <<EOF
+
+Usage:
+ scripts/setup [OPTIONS]
+
+Options:
+ --root ROOT Add a root (can be used multiple times)
+ --encoding ENCODING Filename encoding
+ --port PORT TCP port to listen on or 'none'
+ --smtp-server HOSTNAME SMTP server
+ --email ADDRESS Origin email address
+ --register y|n Enable/disable online registration
+ --play local|network Choose local or network play
+ --mcast ADDRESS PORT Set multicast address and port for --play network
+ -h, --help Display this message
+
+Sets up a basic DisOrder installation. You must have run 'make install'
+first. Use scripts/teardown to stop the server and deconfigure.
+
+EOF
+ exit 0
+ ;;
+ --version | -V )
+ echo "DisOrder scripts/setup _version_"
+ exit 0
+ ;;
+ --root )
+ roots="$roots $1"
+ shift
+ ;;
+ --encoding )
+ encoding="$1"
+ shift
+ ;;
+ --port )
+ port="$1"
+ shift
+ ;;
+ --smtp-server )
+ smtp_server="$1"
+ shift
+ ;;
+ --email )
+ mail_sender="$1"
+ shift
+ ;;
+ --register )
+ register="$1"
+ shift
+ ;;
+ --play )
+ play="$1"
+ shift
+ ;;
+ --mcast )
+ play=network
+ mcast_address="$1"
+ shift
+ mcast_port="$1"
+ shift
+ ;;
+ * )
+ echo >&2 "ERROR: unknown option '$opt'"
+ exit 1
+ ;;
+ esac
+done
+