summaryrefslogtreecommitdiffstats
path: root/contrib/logging.hook
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-12-28 02:38:58 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2012-12-28 02:38:58 +0100
commit4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d (patch)
tree09580c92ca78e8b9b54d7ed8d6b79d7fcd6fd9ff /contrib/logging.hook
parent6737a37e5666837a8f51a2f74bdebdd756151394 (diff)
downloadnetctl-4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d.tar.gz
netctl-4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d.tar.xz
Forking netcfg to netctl (1/2)
This commit contains the moving of files.
Diffstat (limited to 'contrib/logging.hook')
-rwxr-xr-xcontrib/logging.hook86
1 files changed, 0 insertions, 86 deletions
diff --git a/contrib/logging.hook b/contrib/logging.hook
deleted file mode 100755
index 82d0ed1..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 /usr/lib/network/hooks
-
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-
-# if NETCFG_DEBUG is set, debugging messages go to stderr instead of syslog
-
-# What facility to send log messages to? if set to "", nothing will be sent to syslog
-NETCFG_LOG="${NETCFG_LOG-local0}"
-
-
-
-function report_log {
- if [[ -n "$NETCFG_LOG" ]]; 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 "${NETCFG_LOG}.$level" -t "$caller" -- "$*"
- fi
-}
-
-
-function report_err {
- report_log err "$*"
- printhl "$*"
-}
-
-
-function report_notice {
- report_log notice "$*"
- # print "$*" >&2
- checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2
-}
-
-
-function report_debug {
- if checkyesno "$NETCFG_DEBUG"; then
- echo "DEBUG: $*" >&2
- else
- report_log debug "$*"
- fi
-}
-
-
-function report_try {
- report_log notice "trying $*..."
- stat_busy "$*"
- REPORT_TRYING=1
-}
-
-
-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 "- $*"
- REPORT_TRYING=
- fi
- report_log notice "${*:-succeeded}"
- stat_done
-}
-
-# vim: ft=sh ts=4 et sw=4: