fix shecllcheck source directives

This commit is contained in:
Jérémy Lecour 2020-04-02 13:44:13 +02:00 committed by Jérémy Lecour
parent 5432c2eee8
commit 1652ebeb67
20 changed files with 35 additions and 35 deletions

View file

@ -4,7 +4,7 @@
# Usage: check
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
return=0

View file

@ -4,10 +4,10 @@
# Usage: firewall <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ ! -n "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1

View file

@ -4,7 +4,7 @@
# Usage: help
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
cat <<EOF

View file

@ -4,7 +4,7 @@
# Usage: inc
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
create_inc_btrfs() {

View file

@ -4,10 +4,10 @@
# Usage: init <jailname>
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,10 +4,10 @@
# Usage: ip <jailname> [<ip>|all]
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
ip="${2:-}"
if [ ! -n "${jail_name}" ]; then

View file

@ -4,10 +4,10 @@
# Usage: is-on <jailname>
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1

View file

@ -4,10 +4,10 @@
# Usage: key <jailname> [<keyfile>]
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
keyfile="${2:-}"
if [ ! -n "${jail_name}" ]; then

View file

@ -6,7 +6,7 @@
set -eu
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
[ -d "${JAILDIR}" ] || exit 0

View file

@ -4,10 +4,10 @@
# Usage: port <jailname> [<port>|auto]
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
port="${2:-}"
if [ ! -n "${jail_name}" ]; then

View file

@ -4,10 +4,10 @@
# Usage: reload <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,10 +4,10 @@
# Usage: remove <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi
@ -23,7 +23,7 @@ jail_inode=$(stat --format=%i "${jail_path}")
if [ "${jail_inode}" -eq 256 ]; then
/bin/btrfs subvolume delete "${jail_path}" | debug
else
rm -rf "${jail_path}" | debug
rm -rf "${jail_path:?}" | debug
fi
# TODO: use functions here
if [ -d "${incs_path}" ]; then

View file

@ -6,10 +6,10 @@
set -eu
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,7 +4,7 @@
# Usage: rm
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
relative_date() {

View file

@ -4,10 +4,10 @@
# Usage: start <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,7 +4,7 @@
# Usage: stats
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
mkdir -p "${INDEX_DIR}"

View file

@ -4,10 +4,10 @@
# Usage: status [<jailname>]
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail="${1:-}"
jail="${1:?}"
if [ ! -n "${jail}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,10 +4,10 @@
# Usage: stop <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,10 +4,10 @@
# Usage: sync <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ -z "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi

View file

@ -4,10 +4,10 @@
# Usage: update <jailname>|all
#
# shellcheck source=./config
# shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
jail_name="${1:-}"
jail_name="${1:?}"
if [ ! -n "${jail_name}" ]; then
"${LIBDIR}/bkctld-help" && exit 1
fi