From ad81ddafabd95ee1ea7169880a6a80f04babf9a6 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 23 Dec 2008 14:45:30 -0800 Subject: Add some simple status display functions This is useful for displaying daemon status in functions like /etc/rc.d/$DAEMON status Signed-off-by: Aaron Griffin --- functions | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'functions') diff --git a/functions b/functions index cab4141..9eb6c80 100644 --- a/functions +++ b/functions @@ -167,6 +167,26 @@ stop_daemon() { /etc/rc.d/$1 stop } +# Status functions +status_started() { + deltext + echo -ne " $C_OTHER[${C_STRT}STARTED$C_OTHER]$C_CLEAR " +} + +status_stopped() { + deltext + echo -ne " $C_OTHER[${C_STRT}STOPPED$C_OTHER]$C_CLEAR " +} + +ck_status() { + if ck_daemon $1; then + status_started + else + status_stopped + fi +} + + #Source additional functions at the end to allow overrides for f in /etc/rc.d/functions.d/*; do [ -e $f ] && . $f -- cgit v1.2.3