mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Lint with shellcheck (#12666)
This commit is contained in:
4
daily.sh
4
daily.sh
@@ -30,7 +30,7 @@ COMPOSER="php ${LIBRENMS_DIR}/scripts/composer_wrapper.php --no-interaction"
|
|||||||
LOG_DIR=$(php -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${LIBRENMS_DIR}/logs';")
|
LOG_DIR=$(php -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${LIBRENMS_DIR}/logs';")
|
||||||
|
|
||||||
# get the librenms user
|
# get the librenms user
|
||||||
# shellcheck source=/opt/librenms/.env
|
# shellcheck source=.env.example
|
||||||
source "${LIBRENMS_DIR}/.env"
|
source "${LIBRENMS_DIR}/.env"
|
||||||
LIBRENMS_USER="${LIBRENMS_USER:-librenms}"
|
LIBRENMS_USER="${LIBRENMS_USER:-librenms}"
|
||||||
LIBRENMS_USER_ID=$(id -u "$LIBRENMS_USER")
|
LIBRENMS_USER_ID=$(id -u "$LIBRENMS_USER")
|
||||||
@@ -74,7 +74,7 @@ status_run() {
|
|||||||
if [[ "${arg_option}" == "update" ]]; then
|
if [[ "${arg_option}" == "update" ]]; then
|
||||||
php "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}"
|
php "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}"
|
||||||
fi
|
fi
|
||||||
if [[ ! -z "${tmp}" ]]; then
|
if [[ -n "${tmp}" ]]; then
|
||||||
# print output in case of failure
|
# print output in case of failure
|
||||||
echo "${tmp}"
|
echo "${tmp}"
|
||||||
fi
|
fi
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
_lnms_completion()
|
_lnms_completion()
|
||||||
{
|
{
|
||||||
COMPREPLY=(`COMP_CURRENT="${2}" COMP_PREVIOUS="${3}" COMP_LINE="${COMP_LINE}" lnms list:bash-completion`)
|
#shellcheck disable=SC2207
|
||||||
|
COMPREPLY=($(COMP_CURRENT="${2}" COMP_PREVIOUS="${3}" COMP_LINE="${COMP_LINE}" lnms list:bash-completion))
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
complete -F _lnms_completion lnms
|
complete -F _lnms_completion lnms
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
LIBRENMS_DIR=`dirname "$(readlink -f "$0/..")"`
|
LIBRENMS_DIR=$(dirname "$(readlink -f "$0/..")")
|
||||||
cd $LIBRENMS_DIR
|
cd "$LIBRENMS_DIR" || exit
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
''|*[!0-9]*) echo "You must specify a PR number to apply a patch" ;;
|
''|*[!0-9]*) echo "You must specify a PR number to apply a patch" ;;
|
||||||
*) curl -s https://patch-diff.githubusercontent.com/raw/librenms/librenms/pull/${1}.diff | git apply --exclude=*.png -v ${2} ;;
|
*) curl -s https://patch-diff.githubusercontent.com/raw/librenms/librenms/pull/"${1}".diff | git apply --exclude=*.png -v ;;
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user