10-qemu-ga.hotplug 303 B

123456789101112131415
  1. #!/bin/sh
  2. # Copyright (C) 2016 OpenWrt.org
  3. # Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
  4. [ "$SUBSYSTEM" = "virtio-ports" ] || exit 0
  5. syspath="/sys/$DEVPATH"
  6. name="$(cat "$syspath/name" 2>/dev/null)"
  7. [ -n "$name" ] || exit 0
  8. case "$ACTION" in
  9. "add")
  10. /etc/init.d/qemu-ga start
  11. ;;
  12. esac