qubes-rpc-multiplexer 645 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. QUBES_RPC=/etc/qubes-rpc
  3. # XXX: Backward compatibility
  4. DEPRECATED_QUBES_RPC=/etc/qubes_rpc
  5. if ! [ $# = 2 ] ; then
  6. echo $0: bad argument count >&2
  7. exit 1
  8. fi
  9. export QREXEC_REMOTE_DOMAIN="$2"
  10. CFG_FILE=$QUBES_RPC/"$1"
  11. if [ -s "$CFG_FILE" ] ; then
  12. exec /bin/sh "$CFG_FILE"
  13. echo "$0: failed to execute handler for" "$1" >&2
  14. exit 1
  15. fi
  16. CFG_FILE=$DEPRECATED_QUBES_RPC/"$1"
  17. if [ -s "$CFG_FILE" ] ; then
  18. echo "$0: RPC service '$1' uses deprecated directory, please move to $QUBES_RPC" >&2
  19. exec /bin/sh "$CFG_FILE"
  20. echo "$0: failed to execute handler for" "$1" >&2
  21. exit 1
  22. fi
  23. echo "$0: nonexistent or empty" "$CFG_FILE" file >&2
  24. exit 1