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 # Usage: check
# #
# shellcheck source=./config # shellcheck source=./includes
LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes" LIBDIR="$(dirname $0)" && . "${LIBDIR}/includes"
return=0 return=0

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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