#!/bin/sh PORT=5460 if [ -z "${DISPLAY}" ]; then export DISPLAY=:0 fi seat=$(echo ${DISPLAY} | awk -F. '{print $1}') debug="" case $1 in start) if [ "$2" = "-d" ]; then debug="-d" fi ./xrxs -s xrxs ${debug} & sleep 1 9pserve -c unix!/tmp/ns.$(whoami).${seat}/xrxs tcp!0.0.0.0!${PORT} & ;; stop) killall xrxs rm /tmp/ns.$(whoami).${seat}/xrxs ;; *) echo "$0 start|stop" echo " start: run the xrxs service in the background" echo " stop: terminates xrxs services" ;; esac