summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-08-08 16:16:41 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-08-08 16:16:41 (EDT)
commitbe2c43bd159745ac16c89a7136f696077a1ff7b9 (patch)
treeeb653770bd924e2238b31c967c6682880306e259
parent272cdce309f492b13ae2a43ed4291b921efd5e3d (diff)
/etc/init.d/rc: New file.
-rw-r--r--src.etc/init.d/rc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src.etc/init.d/rc b/src.etc/init.d/rc
new file mode 100644
index 0000000..0db7c8d
--- /dev/null
+++ b/src.etc/init.d/rc
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# /etc/init.d/rc
+# Executes init scripts on init and shutdown.
+#
+# Copyright (C) 2012 Patrick "P. J." McDermott
+# This file may be reproduced, distributed, modified, and otherwise dealt in
+# under the terms of the Expat/MIT License.
+
+[ -x /usr/bin/logger ] && logger='logger -s -p 6 -t sysinit' || logger=cat
+
+level=${0#*/rc}
+case ${level} in
+ S)
+ action=start
+ ;;
+ K)
+ action=stop
+ ;;
+ *)
+ exit 1
+ ;;
+esac
+
+for i in /etc/rc.d/${level}*; do
+ [ -x "${i}" ] && "${i}" ${action} 2>&1
+done | ${logger}