From 9b00723bc421ff7a7d632a3e8798496aa726ee40 Mon Sep 17 00:00:00 2001 From: James Swineson Date: Sat, 24 Aug 2019 14:42:32 +0800 Subject: [PATCH] add library mode --- menhera.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/menhera.sh b/menhera.sh index a235d31..990e540 100755 --- a/menhera.sh +++ b/menhera.sh @@ -179,6 +179,21 @@ clear_processes() { } # main procedure +LIBRARY_ONLY=0 + +while test $# -gt 0 +do + case "$1" in + --lib) LIBRARY_ONLY=1 + ;; + esac + shift +done + +if [[ $LIBRARY_ONLY -eq 1 ]]; then + # acting as a library only + exit 0 +fi if [[ $EUID -ne 0 ]]; then echo "This script must be run as root"