diff options
author | Bill Nottingham <notting@redhat.com> | 2011-03-25 15:57:14 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2011-03-25 15:57:14 -0400 |
commit | ac1bb973ece7e34f2f9a1606f4b9559e48b2e131 (patch) | |
tree | 3ddef66d9865684ce014884d70ebc5e55533f33d | |
parent | 5e2b364ebd6808c43f46f7853d2fe6de4edbada1 (diff) | |
download | initscripts-ac1bb973ece7e34f2f9a1606f4b9559e48b2e131.tar initscripts-ac1bb973ece7e34f2f9a1606f4b9559e48b2e131.tar.gz initscripts-ac1bb973ece7e34f2f9a1606f4b9559e48b2e131.tar.bz2 initscripts-ac1bb973ece7e34f2f9a1606f4b9559e48b2e131.tar.xz initscripts-ac1bb973ece7e34f2f9a1606f4b9559e48b2e131.zip |
Add a net_log() function. (#507515, #689525)
-rw-r--r-- | sysconfig/network-scripts/network-functions | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 9a47449b..ed318b0e 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -424,3 +424,26 @@ change_resolv_conf () fi; return $r; } + +# Logging function +# +# Usage: net_log <message> <err|warning|info> <optional file/function name> +# +# Default level is 'info'. + +net_log() { + local message="$1" + local level="$2" + local name="$3" + + [ -z "$message" ] && return 1 + [ -z "$level" ] && level=info + [ -z "$name" ] && name=$0 + + echo $message + + if [ -x /usr/bin/logger ]; then + /usr/bin/logger -p daemon.$level -t "$name" "$message" + fi + return 0 +} |