1
0

debian.vbladed-check-params.patch 686 B

123456789101112131415161718192021222324
  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. Forwarded: no
  6. Last-Update: 2007-04-08
  7. --- a/vbladed
  8. +++ b/vbladed
  9. @@ -3,4 +3,14 @@
  10. # output is directed to syslogd
  11. #
  12. +# Although logging goes to syslog, let's going to
  13. +# protect ourselves against the most common way or
  14. +# calling vbladed: without arguments. While at it, we guard
  15. +# ourselves against wrong number of parameters.
  16. +if [ $# -lt 4 ]
  17. +then
  18. + echo "usage: ./vblade <shelf> <slot> <ethn> <device>" >&2
  19. + exit 1
  20. +fi
  21. +
  22. sh -c "`dirname $0`/vblade $* < /dev/null 2>&1 | logger -t vbladed" &