--- /dev/null
+#!/bin/bash
+# -------------------------------------------------------------------
+# Fetch and run the latest staff client build from a KCLS EG server.
+# -------------------------------------------------------------------
+set -eu
+SERVER=""
+CLIENT_DIR="$HOME/staff_client"
+XUL_BUNDLE="xulrunner-14.0.1.en-US.linux-x86_64.tar.bz2"
+XUL_URL="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/14.0.1/runtimes/$XUL_BUNDLE"
+
+function usage {
+ cat <<USAGE
+Usage:
+ $0 -s <server-name-or-ip>
+USAGE
+ exit;
+}
+
+while getopts "s:h" opt; do
+ case $opt in
+ s) SERVER=$OPTARG;;
+ h) usage;
+ esac
+done;
+
+[ -z "$SERVER" ] && usage;
+
+mkdir -p $CLIENT_DIR
+cd $CLIENT_DIR
+
+if [ ! -d xulrunner ]; then
+ wget $XUL_URL
+ tar -jxf $XUL_BUNDLE
+fi
+
+rm -f current-client-build.zip;
+rm -rf build;
+
+# fetch new build
+wget "http://$SERVER/xul/builds/current-client-build.zip"
+unzip current-client-build.zip
+cd build
+../xulrunner/xulrunner-bin application.ini
+