[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[firstboot_rhel6-branch] Add status to the init script (#753658)



---
 init/firstboot |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/init/firstboot b/init/firstboot
index 1f3462c..67ed52c 100755
--- a/init/firstboot
+++ b/init/firstboot
@@ -88,7 +88,24 @@ case "$1" in
         exit 0
         ;;
 
-    restart | reload | force-reload | status | condrestart | try-restart)
+    status)
+        /sbin/chkconfig --list firstboot | grep on >/dev/null
+        RETVAL=$?
+
+        if [ "$RETVAL" -eq 0 ]; then
+            if [ ! -f $FILENAME ] || [ -z "$(grep 'RUN_FIRSTBOOT=NO' $FILENAME)" ]; then
+                echo $"firstboot is scheduled to run"
+            else
+                echo $"firstboot is not scheduled to run"
+            fi
+        else
+            echo $"firstboot is not scheduled to run"
+        fi
+
+        exit 0
+        ;;
+
+    restart | reload | force-reload | condrestart | try-restart)
         usage
         exit 3
         ;;
-- 
1.7.5.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]