|
@@ -8,9 +8,11 @@
|
|
|
# - Initial release of the script
|
|
# - Initial release of the script
|
|
|
# v1.1:
|
|
# v1.1:
|
|
|
# - Aligned quotation marks around variables cosistently
|
|
# - Aligned quotation marks around variables cosistently
|
|
|
-
|
|
|
|
|
|
|
+# v1.2:
|
|
|
|
|
+# - started refining the script to a more modern bash-style
|
|
|
|
|
+#
|
|
|
# Current active version of the script
|
|
# Current active version of the script
|
|
|
-SCRIPT_VERSION=1.1
|
|
|
|
|
|
|
+SCRIPT_VERSION=1.2
|
|
|
|
|
|
|
|
################################################################
|
|
################################################################
|
|
|
# Global definitions for the script - change to fit your needs #
|
|
# Global definitions for the script - change to fit your needs #
|
|
@@ -38,8 +40,8 @@ then
|
|
|
then
|
|
then
|
|
|
echo "DEBUG: gwMTA is enabled in config, checking for the process."
|
|
echo "DEBUG: gwMTA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
- gwMTAProcess=$(ps -ef | grep "gwmta" | grep -v grep | awk '{print $2}')
|
|
|
|
|
- if [ ! -z "$gwMTAProcess" ]
|
|
|
|
|
|
|
+ gwMTAProcess=$(pgrep -x gwmta)
|
|
|
|
|
+ if [[ -n "$gwMTAProcess" ]]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
|
then
|
|
then
|
|
@@ -77,7 +79,7 @@ then
|
|
|
then
|
|
then
|
|
|
echo "DEBUG: gwPOA is enabled in config, checking for the process."
|
|
echo "DEBUG: gwPOA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
- gwPOAProcess=$(ps -ef | grep "gwpoa" | grep -v grep | awk '{print $2}')
|
|
|
|
|
|
|
+ gwPOAProcess=$(pgrep -x gwpoa)
|
|
|
if [ ! -z "$gwPOAProcess" ]
|
|
if [ ! -z "$gwPOAProcess" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|
|
@@ -114,7 +116,7 @@ then
|
|
|
then
|
|
then
|
|
|
echo "DEBUG: gwIA is enabled in config, checking for the process."
|
|
echo "DEBUG: gwIA is enabled in config, checking for the process."
|
|
|
fi
|
|
fi
|
|
|
- gwIAProcess=$(ps -ef | grep "gwia" | grep -v grep | awk '{print $2}')
|
|
|
|
|
|
|
+ gwIAProcess=$(pgrep -x gwia)
|
|
|
if [ ! -z "$gwIAProcess" ]
|
|
if [ ! -z "$gwIAProcess" ]
|
|
|
then
|
|
then
|
|
|
gwIAListener=$(ss -lpn | grep "$gwIAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
gwIAListener=$(ss -lpn | grep "$gwIAProcess" |awk '{print $5}' | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
|
|
@@ -141,7 +143,7 @@ then
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-gwAdminProcess=$(ps -ef | grep gwadmin.jar | grep -v grep | awk '{print $2}')
|
|
|
|
|
|
|
+gwAdminProcess=$(pgrep -f 'gwadmin\.jar')
|
|
|
if [ ! -z "$gwAdminProcess" ]
|
|
if [ ! -z "$gwAdminProcess" ]
|
|
|
then
|
|
then
|
|
|
if [ "$debug" -eq 1 ]
|
|
if [ "$debug" -eq 1 ]
|