diff options
author | James Rayner <james@archlinux.org> | 2009-08-10 08:09:16 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-08-10 08:09:16 +0200 |
commit | 9a3078d8cec470b3820c5597d5c8819d642e558d (patch) | |
tree | 7287f79ad908eb8cd6352b19c3e59e6bc57e4c94 /contrib/logging.hook | |
parent | 280b25e1171a4609356e888066614a4dc2ecb678 (diff) | |
download | netctl-9a3078d8cec470b3820c5597d5c8819d642e558d.tar.gz netctl-9a3078d8cec470b3820c5597d5c8819d642e558d.tar.xz |
revert pryor patch
Diffstat (limited to 'contrib/logging.hook')
-rwxr-xr-x | contrib/logging.hook | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/contrib/logging.hook b/contrib/logging.hook deleted file mode 100755 index 27a7c39..0000000 --- a/contrib/logging.hook +++ /dev/null @@ -1,86 +0,0 @@ -### Sample netcfg hook script for logging/debugging connections -### To install, make this executable and put it in /etc/network.d/hooks - - -# These functions are loaded after, and override, the ones in /usr/lib/network/globals - -# uncomment one of the following lines -#function report_log { report_syslog "$@"; } -#function report_log { report_stderr "$@"; } - - - - - -# What facility to send log messages to? -NETCFGLOG="${NETCFGLOG-local0}" - -function report_syslog { - if [[ -n "$NETCFGLOG" ]]; then - local caller level="$1" - shift - case "$0" in - net-auto|netcfg-auto-*) caller=net-auto;; - net-profiles) caller=net-profiles;; - net-rename) caller=net-rename;; - *) caller=netcfg;; - esac - logger -p "${NETCFGLOG}.$level" -t "$caller" -- "$*" - fi -} - -function report_stderr { - local level="$1" - shift - echo "netcfg $level: $*" >&2 -} - -function report_err { - report_log err "$*" - printhl "$*" -} - -function report_warn { - report_log warning "$*" - # printhl "$*" -} - -function report_notify { - report_log notice "$*" - # print "$*" >&2 -} - -function report_debug { - report_log debug "$*" -} - -function report_try { - report_log notice "trying $*..." - REPORT_TRYING=1 - stat_busy "$*" -} - -function report_fail { - if [[ -n "$*" ]]; then - report_log err "$*" - if [[ -n "$REPORT_TRYING" ]]; then - stat_append "- $*" - REPORT_TRYING= - stat_fail - else - printhl "$*" - fi - elif [[ -n "$REPORT_TRYING" ]]; then - REPORT_TRYING= - stat_fail - fi -} - -function report_success { - if [[ -n "$*" ]]; then - stat_append "- $*" - fi - report_log notice "${*:-succeeded}" - stat_done -} - |