mirror of
https://github.com/rvalitov/zabbix-php-fpm.git
synced 2023-11-05 03:30:27 +01:00
[add] detect current user
This commit is contained in:
parent
68e5a4d377
commit
0af188ec6d
@ -15,6 +15,7 @@ S_CAT=`type -P cat`
|
|||||||
S_BASH=`type -P bash`
|
S_BASH=`type -P bash`
|
||||||
S_ECHO=`type -P echo`
|
S_ECHO=`type -P echo`
|
||||||
S_PRINTF=`type -P printf`
|
S_PRINTF=`type -P printf`
|
||||||
|
S_WHOAMI=`type -P whoami`
|
||||||
|
|
||||||
if [[ ! -f $S_PS ]]; then
|
if [[ ! -f $S_PS ]]; then
|
||||||
${S_ECHO} "Utility 'ps' not found. Please, install it first."
|
${S_ECHO} "Utility 'ps' not found. Please, install it first."
|
||||||
@ -60,9 +61,14 @@ if [[ ! -f ${S_PRINTF} ]]; then
|
|||||||
${S_ECHO} "Utility 'printf' not found. Please, install it first."
|
${S_ECHO} "Utility 'printf' not found. Please, install it first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ ! -f ${S_WHOAMI} ]]; then
|
||||||
|
${S_ECHO} "Utility 'whoami' not found. Please, install it first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
STATUS_PATH="/php-fpm-status"
|
STATUS_PATH="/php-fpm-status"
|
||||||
DEBUG_MODE=""
|
DEBUG_MODE=""
|
||||||
|
ACTIVE_USER=`${S_WHOAMI}`
|
||||||
|
|
||||||
# Prints a string on screen. Works only if debug mode is enabled.
|
# Prints a string on screen. Works only if debug mode is enabled.
|
||||||
function PrintDebug(){
|
function PrintDebug(){
|
||||||
@ -178,6 +184,7 @@ for ARG in "$@"; do
|
|||||||
PrintDebug "Argument $ARG is unknown and skipped"
|
PrintDebug "Argument $ARG is unknown and skipped"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
PrintDebug "Current user is $ACTIVE_USER"
|
||||||
PrintDebug "Status path to be used: $STATUS_PATH"
|
PrintDebug "Status path to be used: $STATUS_PATH"
|
||||||
|
|
||||||
LOCAL_DIR=`${S_DIRNAME} $0`
|
LOCAL_DIR=`${S_DIRNAME} $0`
|
||||||
|
Loading…
Reference in New Issue
Block a user