03_vblade_usage.patch 710 B

123456789101112131415161718192021
  1. 03_vblade_usage.patch: Used for avoiding calling vbladed without arguments,
  2. and while at it, add the usage command line.
  3. Index: vblade-20/vbladed
  4. ===================================================================
  5. --- vblade-20.orig/vbladed
  6. +++ vblade-20/vbladed
  7. @@ -3,4 +3,14 @@
  8. # output is directed to syslogd
  9. #
  10. +# Although logging goes to syslog, let's going to
  11. +# protect ourselves against the most common way or
  12. +# calling vbladed: without arguments. While at it, we guard
  13. +# ourselves against wrong number of parameters.
  14. +if [ $# -lt 4 ]
  15. +then
  16. + echo "usage: ./vblade <shelf> <slot> <ethn> <device>" >&2
  17. + exit 1
  18. +fi
  19. +
  20. sh -c "`dirname $0`/vblade $* < /dev/null 2>&1 | logger -t vbladed" &