aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slugos-init/files/initscripts/syslog.network
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/slugos-init/files/initscripts/syslog.network')
-rw-r--r--recipes/slugos-init/files/initscripts/syslog.network28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes/slugos-init/files/initscripts/syslog.network b/recipes/slugos-init/files/initscripts/syslog.network
new file mode 100644
index 0000000000..3d7f4ab8e6
--- /dev/null
+++ b/recipes/slugos-init/files/initscripts/syslog.network
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Invoke the syslog startup if the configuration
+# uses 'remote', or doesn't use 'buffer' or 'file'
+DESTINATION=
+test -f /etc/syslog.conf && . /etc/syslog.conf
+doit=
+doneit=
+
+for d in $DESTINATION
+do
+ case "$d" in
+ buffer) doneit=1;;
+ file) doneit=1;;
+ remote) doit=1;;
+ *) doit=1
+ echo "/etc/syslog.conf: $d: unknown destination" >&2
+ exit 1;;
+ esac
+done
+
+# One of doneit or doit is set unless the DESTINATION value
+# is empty (which is probably an error), let syslog handle
+# the error.
+test \( -n "$doit" -o -z "$doneit" \) -a -x /etc/init.d/syslog &&
+ exec /etc/init.d/syslog "$@"
+
+exit 0