Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build-kernel/bin/shutdown.sh')
-rwxr-xr-xbuild-kernel/bin/shutdown.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/build-kernel/bin/shutdown.sh b/build-kernel/bin/shutdown.sh
new file mode 100755
index 00000000..aac5ff46
--- /dev/null
+++ b/build-kernel/bin/shutdown.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+SCRIPT="$0"
+
+# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
+while [ -h "$SCRIPT" ] ; do
+ ls=`ls -ld "$SCRIPT"`
+ # Drop everything prior to ->
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT=`dirname "$SCRIPT"`/"$link"
+ fi
+done
+
+SCRIPT_DIR=`dirname $SCRIPT`
+EXECUTABLE="dmk.sh"
+
+exec "$SCRIPT_DIR"/"$EXECUTABLE" stop "$@"

Back to the top