diff options
Diffstat (limited to 'rc_status')
-rwxr-xr-x | rc_status | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/rc_status b/rc_status new file mode 100755 index 0000000..d547555 --- /dev/null +++ b/rc_status @@ -0,0 +1,57 @@ +#!/bin/sh +# +# rc_status - show status of boot scripts +# +# Copyright (c) 2005 Natanael Copa +# +# Distributed under GPL-2 +# + +PROGRAM=`basename $0` + +#load the libraries +. /sbin/functions.sh + +die() { + echo "$1" >&2 + exit 1 +} + +# print usage and die +usage() { + echo "$PROGRAM $VERSION" + echo "usage: $PROGRAM [-hv] [-l level] [script]" + echo "" + echo " -h Show help and exit." + echo " -l Show only specified level." + echo " -v Turn on verbose output." + echo "" + exit 1 +} + +#parse args +while getopts "hl:v" opt ; do + case "$opt" in + h) usage;; + l) case "$OPTARG" in + S|L|K) LEVELS="$LEVELS $OPTARG";; + *) die "Valid levels are: all, S, K and L";; + esac + ;; + v) VERBOSE="-v" ;; + \?) usage;; + esac +done +shift `expr $OPTIND - 1` + +cd "$ROOT/etc" + +[ -z "$LEVELS" ] && LEVELS="S L K" + +for i in $LEVELS ; do + echo "rc$i.d:" + ls -1 $VERBOSE rc$i.d 2>/dev/null + echo "" +done + +exit |