diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-12-23 14:45:30 -0800 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-12-23 14:45:30 -0800 |
commit | ad81ddafabd95ee1ea7169880a6a80f04babf9a6 (patch) | |
tree | 6e71b5e85e302d2cd6c59eac0e8f6bce5b7a407b /functions | |
parent | fa4f2f14870500eeab3233da07647a7c2c5e1648 (diff) |
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 <aaronmgriffin@gmail.com>
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 |