2014-01-22 01:30:03 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Log all environment variables to ZED_DEBUG_LOG.
|
|
|
|
#
|
2015-02-18 04:23:54 +03:00
|
|
|
# This can be a useful aid when developing/debugging ZEDLETs since it shows the
|
|
|
|
# environment variables defined for each zevent.
|
2014-01-22 01:30:03 +04:00
|
|
|
|
2015-02-18 04:23:54 +03:00
|
|
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
|
|
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
|
|
|
|
|
|
|
: "${ZED_DEBUG_LOG:="${TMPDIR:="/tmp"}/zed.debug.log"}"
|
2014-01-22 01:30:03 +04:00
|
|
|
|
2015-02-18 04:23:54 +03:00
|
|
|
lockfile="$(basename -- "${ZED_DEBUG_LOG}").lock"
|
|
|
|
|
|
|
|
umask 077
|
|
|
|
zed_lock "${lockfile}"
|
|
|
|
exec >> "${ZED_DEBUG_LOG}"
|
2014-01-22 01:30:03 +04:00
|
|
|
|
|
|
|
printenv | sort
|
|
|
|
echo
|
|
|
|
|
2015-02-18 04:23:54 +03:00
|
|
|
exec >&-
|
|
|
|
zed_unlock "${lockfile}"
|
2014-01-22 01:30:03 +04:00
|
|
|
exit 0
|