Fix linter issues
This commit is contained in:
parent
7284a0866f
commit
2a6e9c2a0a
@ -52,8 +52,8 @@ typeset -r TMP_DIR="/var/tmp"
|
|||||||
typeset -r EXEC_USER="root"
|
typeset -r EXEC_USER="root"
|
||||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||||
# read-only settings (but should not be changed)
|
# read-only settings (but should not be changed)
|
||||||
typeset -r SCRIPT_NAME="$(basename $0)"
|
typeset -r SCRIPT_NAME=$(basename "$0")
|
||||||
typeset -r SCRIPT_DIR="$(dirname $0)"
|
typeset -r SCRIPT_DIR=$(dirname "$0")
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
typeset -r HOST_NAME="$(hostname)"
|
typeset -r HOST_NAME="$(hostname)"
|
||||||
typeset -r OS_NAME="$(uname -s)"
|
typeset -r OS_NAME="$(uname -s)"
|
||||||
@ -229,7 +229,7 @@ function check_core
|
|||||||
# check and include core helper libs
|
# check and include core helper libs
|
||||||
if [[ -r ${FPATH_PARENT}/core/include_core.sh && -h ${FPATH_PARENT}/core/include_core ]]
|
if [[ -r ${FPATH_PARENT}/core/include_core.sh && -h ${FPATH_PARENT}/core/include_core ]]
|
||||||
then
|
then
|
||||||
# shellcheck source=/opt/hc/lib/core/include_core.sh
|
# shellcheck source=/dev/null
|
||||||
. ${FPATH_PARENT}/core/include_core.sh
|
. ${FPATH_PARENT}/core/include_core.sh
|
||||||
else
|
else
|
||||||
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_core.sh is not present (tip: run --fix-symlinks)"
|
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_core.sh is not present (tip: run --fix-symlinks)"
|
||||||
@ -237,7 +237,7 @@ else
|
|||||||
fi
|
fi
|
||||||
if [[ -r ${FPATH_PARENT}/core/include_data.sh && -h ${FPATH_PARENT}/core/include_data ]]
|
if [[ -r ${FPATH_PARENT}/core/include_data.sh && -h ${FPATH_PARENT}/core/include_data ]]
|
||||||
then
|
then
|
||||||
# shellcheck source=/opt/hc/lib/core/include_data.sh
|
# shellcheck source=/dev/null
|
||||||
. ${FPATH_PARENT}/core/include_data.sh
|
. ${FPATH_PARENT}/core/include_data.sh
|
||||||
else
|
else
|
||||||
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_data.sh is not present (tip: run --fix-symlinks)"
|
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_data.sh is not present (tip: run --fix-symlinks)"
|
||||||
@ -245,7 +245,7 @@ else
|
|||||||
fi
|
fi
|
||||||
if [[ -r ${FPATH_PARENT}/core/include_os.sh && -h ${FPATH_PARENT}/core/include_os ]]
|
if [[ -r ${FPATH_PARENT}/core/include_os.sh && -h ${FPATH_PARENT}/core/include_os ]]
|
||||||
then
|
then
|
||||||
# shellcheck source=/opt/hc/lib/core/include_os.sh
|
# shellcheck source=/dev/null
|
||||||
. ${FPATH_PARENT}/core/include_os.sh
|
. ${FPATH_PARENT}/core/include_os.sh
|
||||||
else
|
else
|
||||||
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_os.sh is not present (tip: run --fix-symlinks)"
|
print -u2 "ERROR: library file ${FPATH_PARENT}/core/include_os.sh is not present (tip: run --fix-symlinks)"
|
||||||
@ -480,8 +480,7 @@ function check_user
|
|||||||
typeset WHOAMI=""
|
typeset WHOAMI=""
|
||||||
|
|
||||||
# avoid sub-shell for mksh/pdksh
|
# avoid sub-shell for mksh/pdksh
|
||||||
# shellcheck disable=SC2046
|
WHOAMI=$(IFS='()'; set -- "$(id)"; print $2)
|
||||||
WHOAMI=$(IFS='()'; set -- $(id); print $2)
|
|
||||||
if [[ "${WHOAMI}" != "${EXEC_USER}" ]]
|
if [[ "${WHOAMI}" != "${EXEC_USER}" ]]
|
||||||
then
|
then
|
||||||
print -u2 "ERROR: must be run as user '${EXEC_USER}'"
|
print -u2 "ERROR: must be run as user '${EXEC_USER}'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user