summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gentoo-run-directory')
-rwxr-xr-xbin/gentoo-run-directory22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/gentoo-run-directory b/bin/gentoo-run-directory
new file mode 100755
index 0000000..93970a2
--- /dev/null
+++ b/bin/gentoo-run-directory
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ ${#} -ne 2 ]; then
+ echo "Synopsis: ${0} <path> .<suffix>" >&2
+ exit 1
+fi
+
+if ! cd "${1}"; then
+ echo "Unable to cd into ${1}" >&2
+ exit 1
+fi
+
+for f in ./*"${2}"; do
+ if [ -x "${f}" ]; then
+ echo "* Starting ${f}" >&2
+ if ! "${f}"; then
+ echo "! Failed to start ${f}: ${?}" >&2
+ fi
+ elif [ -f "${f}" ]; then
+ echo "* Omitting ${f} (non-executable)" >&2
+ fi
+done