]> granicus.if.org Git - zfs/commit
Cleanup ZEDLETs
authorChris Dunlap <cdunlap@llnl.gov>
Wed, 18 Feb 2015 01:23:54 +0000 (17:23 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 27 Apr 2015 19:08:01 +0000 (12:08 -0700)
commitaded9a6814c9f6260437bc186ad08debc5d0b6c8
tree9ad772349943effa8953d8ec723aff8aa07320a4
parent0336f3d001c76625281919bcf9e534d1976f3c36
Cleanup ZEDLETs

This commit factors out several common ZEDLET code blocks into
zed-functions.sh.  This shortens the length of the scripts, thereby
(hopefully) making them easier to understand and maintain.

In addition, this commit revamps the coding style used by the
scripts to be more consistent and (again, hopefully) maintainable.
It now mostly follows the Google Shell Style Guide.  I've tried to
assimilate the following resources:

  Google Shell Style Guide
  https://google-styleguide.googlecode.com/svn/trunk/shell.xml

  Dash as /bin/sh
  https://wiki.ubuntu.com/DashAsBinSh

  Filenames and Pathnames in Shell: How to do it Correctly
  http://www.dwheeler.com/essays/filenames-in-shell.html

  Common shell script mistakes
  http://www.pixelbeat.org/programming/shell_script_mistakes.html

Finally, this commit updates the exit codes used by the ZEDLETs to be
more consistent with one another.

All scripts run cleanly through ShellCheck <http://www.shellcheck.net/>.
All scripts have been tested on bash and dash.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
cmd/zed/Makefile.am
cmd/zed/zed.d/README [new file with mode: 0644]
cmd/zed/zed.d/all-debug.sh
cmd/zed/zed.d/all-syslog.sh
cmd/zed/zed.d/data-email.sh
cmd/zed/zed.d/generic-email.sh
cmd/zed/zed.d/io-email.sh
cmd/zed/zed.d/io-spare.sh
cmd/zed/zed.d/scrub.finish-email.sh
cmd/zed/zed.d/zed-functions.sh [new file with mode: 0644]
cmd/zed/zed.d/zed.rc