2021-08-04 05:21:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-03-07 19:31:49 +00:00
|
|
|
if [ -z "${XRXS_PORT}" ]; then
|
|
|
|
XRXS_PORT=5460
|
|
|
|
else
|
2021-08-04 05:21:14 +00:00
|
|
|
|
2021-10-16 17:23:46 +00:00
|
|
|
if [ -z "${DISPLAY}" ]; then
|
2021-10-15 06:00:46 +00:00
|
|
|
export DISPLAY=:0
|
|
|
|
fi
|
|
|
|
|
2021-10-16 17:23:46 +00:00
|
|
|
seat=$(echo ${DISPLAY} | awk -F. '{print $1}')
|
|
|
|
|
|
|
|
debug=""
|
|
|
|
|
2021-08-04 05:21:14 +00:00
|
|
|
case $1 in
|
|
|
|
start)
|
2021-10-16 17:23:46 +00:00
|
|
|
if [ "$2" = "-d" ]; then
|
|
|
|
debug="-d"
|
|
|
|
fi
|
|
|
|
./xrxs -s xrxs ${debug} & sleep 1
|
2022-03-07 19:31:49 +00:00
|
|
|
9pserve -c unix!/tmp/ns.$(whoami).${seat}/xrxs tcp!0.0.0.0!${XRXS_PORT} &
|
2021-08-04 05:21:14 +00:00
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
killall xrxs
|
2021-10-16 17:23:46 +00:00
|
|
|
rm /tmp/ns.$(whoami).${seat}/xrxs
|
2021-08-04 05:21:14 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "$0 start|stop"
|
|
|
|
echo " start: run the xrxs service in the background"
|
|
|
|
echo " stop: terminates xrxs services"
|
|
|
|
;;
|
|
|
|
esac
|