local.vbladed-check-params.patch 672 B

1234567891011121314151617181920212223
  1. Subject: Used for avoiding calling vbladed without arguments,
  2. and while at it, add the usage command line.
  3. Author: David Martínez Moreno <ender@debian.org>
  4. Date: 2005-10-28
  5. Last-Update: 2007-04-08
  6. --- a/vbladed
  7. +++ b/vbladed
  8. @@ -3,4 +3,14 @@
  9. # output is directed to syslogd
  10. #
  11. +# Although logging goes to syslog, let's going to
  12. +# protect ourselves against the most common way or
  13. +# calling vbladed: without arguments. While at it, we guard
  14. +# ourselves against wrong number of parameters.
  15. +if [ $# -lt 4 ]
  16. +then
  17. + echo "usage: ./vblade <shelf> <slot> <ethn> <device>" >&2
  18. + exit 1
  19. +fi
  20. +
  21. sh -c "`dirname $0`/vblade $* < /dev/null 2>&1 | logger -t vbladed" &