Moved to slp format, also removed sysvinit dependency (unsure why it was there)
This commit is contained in:
39
SL/runall
Executable file
39
SL/runall
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage () {
|
||||
echo "Usage: ${0#*/} [DIRECTORY]..."
|
||||
echo "Run all executable scripts in one or more directories"
|
||||
|
||||
exit $1
|
||||
}
|
||||
|
||||
ERRORS=
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
usage 2
|
||||
fi
|
||||
|
||||
for dir in "$@"; do
|
||||
dir=${dir%/}
|
||||
if [ ! -d "$dir" ]; then
|
||||
echo "$dir: invalid directory"
|
||||
|
||||
usage 2
|
||||
fi
|
||||
|
||||
for file in "$dir"/*; do
|
||||
if [ -x "$file" ]; then
|
||||
"$file"
|
||||
|
||||
if [ "$?" -gt 0 ]; then
|
||||
ERRORS="$ERRORS $file"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [ -n "$ERRORS" ]; then
|
||||
echo "There were errors in the following scripts:$ERRORS"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user