summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-12-23 14:45:30 -0800
committerAaron Griffin <aaronmgriffin@gmail.com>2008-12-23 14:45:30 -0800
commitad81ddafabd95ee1ea7169880a6a80f04babf9a6 (patch)
tree6e71b5e85e302d2cd6c59eac0e8f6bce5b7a407b /functions
parentfa4f2f14870500eeab3233da07647a7c2c5e1648 (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--functions20
1 files changed, 20 insertions, 0 deletions
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