[Fuego] [PATCH] Add function to get the status of module.

Wang Mingyu <[email protected]>
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
Signed-off-by: Wang Mingyu <[email protected]>
---
 scripts/fuego_board_function_lib.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/scripts/fuego_board_function_lib.sh b/scripts/fuego_board_function_lib.sh
index a6cd842..115c615 100644
--- a/scripts/fuego_board_function_lib.sh
+++ b/scripts/fuego_board_function_lib.sh
@@ -12,6 +12,7 @@
 init_manager="init_manager-not-set"
 logger_service="logger_service-not-set"
 service_status="unknown"
+module_status="unknown"
 
 # set_init_manager:
 #   detects and sets the init_manager variable, which indicates which
@@ -100,3 +101,16 @@ get_service_logfile() {
     fi
     echo $service_logfile
 }
+
+# get_module_status:
+# get status of module
+# returns: status of module
+get_module_status() {
+    if lsmod | grep $1
+    then
+        module_status="loaded"
+    else
+        module_status="unloaded"
+    fi
+    echo $module_status
+}
-- 
2.17.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.