Fix remaining shellcheck problems.

This commit is contained in:
Darko Poljak 2018-10-07 10:20:08 +02:00
parent e9b823bc39
commit 334201b945
11 changed files with 10 additions and 7 deletions

View file

@ -9,6 +9,7 @@ __directory "$servicedir" --mode 700
os=$(cat "$__global/explorer/os")
init=$(cat "$__global/explorer/init")
require=""
case $os in
freebsd)
# TODO change to __start_on_boot once it supports freebsd

View file

@ -3,6 +3,7 @@
os=$(cat "$__global/explorer/os")
os_version=$(cat "$__global/explorer/os_version")
require=""
case $os in
debian|devuan)
case $os_version in

View file

@ -37,7 +37,7 @@ jaildir="$(cat "$__object/parameter/jaildir")"
__directory "${jaildir}" --parents
set -- "$@" "$__object_id" "--state" "$state"
set -- "$@" "$__object_id"
cd "$__object/parameter"
for property in *; do
set -- "$@" "--$property" "$(cat "$property")"

View file

@ -91,7 +91,7 @@ if [ -f "${__object}/parameter/automatic-renewal" ]; then
renew_hook_param="${__object}/parameter/renew-hook"
renew_hook=""
if [ -f "${renew_hook_param}" ]; then
while read hook; do
while read -r hook; do
renew_hook="${renew_hook} --renew-hook \"${hook}\""
done < "${renew_hook_param}"
fi

View file

@ -31,7 +31,7 @@ printf " %s" "$type"
options="$(cat "$__object/parameter/options")"
printf " %s" "$options"
printf " %s" "$(cat "$__object/parameter/dump")"
printf " %s\n" "$(cat "$__object/parameter/pass")"
printf ' %s\n' "$(cat "$__object/parameter/pass")"
) | \
__block "$__object_name" \
--file "/etc/fstab" \

View file

@ -50,7 +50,6 @@ entry="$__object/files/entry"
echo "# $(cat "$__object/parameter/comment")"
fi
printf "%s " "$service"
printf "%s " "$type"
for parameter in type private unpriv chroot wakeup maxproc; do
printf "%s " "$(cat "$__object/parameter/$parameter")"
done

View file

@ -52,8 +52,7 @@ case "$state_should" in
if [ -f "$__object/parameter/stop" ]; then
cat "$__object/parameter/stop"
else
# TODO: what should be runs variable?
echo kill "${runs}"
echo kill "$(cat "$__object/parameter/runs")"
fi
echo "stopped" >> "$__messages_out"
;;

View file

@ -15,6 +15,7 @@ storage_path="$(cat "$__object/parameter/storage-path")"
##### INSTALL THE PACKAGE ###################################################
require_pkg="" # what to require if I want to require "the package"
require=""
if [ -f "$__object/parameter/install-from-backports" ]; then
os=$(cat "$__global/explorer/os")
os_version=$(cat "$__global/explorer/os_version")

View file

@ -7,6 +7,7 @@ exporter="$(cat "$__object/parameter/exporter")"
__user prometheus --system
require=""
case $exporter in
node)
TEXTFILES=/service/node-exporter/textfiles # path for the textfiles collector

View file

@ -18,6 +18,7 @@ rule_files="$(cat "$__object/parameter/rule-files")"
##### INSTALL THE PACKAGE ###################################################
require_pkg="" # what to require if I want to require "the package"
require=""
if [ -f "$__object/parameter/install-from-backports" ]; then
os=$(cat "$__global/explorer/os")
os_version=$(cat "$__global/explorer/os_version")

View file

@ -61,7 +61,7 @@ _cksum() {
echo "$1" | cksum | cut -d' ' -f 1
}
while read key; do
while read -r key; do
type_and_key="$(echo "$key" | tr ' ' '\n' | awk '/^(ssh|ecdsa)-[^ ]+/ { printf $1" "; getline; printf $1 }')"
object_id="$(_cksum "$file")-$(_cksum "$type_and_key")"
set -- "$object_id"