server: lint: More quotes
This commit is contained in:
parent
69a24c2108
commit
91b5f37bc3
6 changed files with 8 additions and 8 deletions
2
server/lib/bkctld-inc-lock
Normal file → Executable file
2
server/lib/bkctld-inc-lock
Normal file → Executable file
|
@ -38,7 +38,7 @@ unlock_target() {
|
|||
}
|
||||
|
||||
# this directory test must be quoted,beacause of the probable globbing
|
||||
if [ -d ${target_path} ]; then
|
||||
if [ -d "${target_path}" ]; then
|
||||
if [ "${lock_status}" = "on" ]; then
|
||||
lock_target "${target_path}"
|
||||
elif [ "${lock_status}" = "off" ]; then
|
||||
|
|
|
@ -18,7 +18,7 @@ test -d "${jail_path}" || error "${jail_name}: jail not found" 2
|
|||
|
||||
# Error codes are references in "includes" file
|
||||
return=100
|
||||
if systemctl is-active --quiet systemd-nspawn@${jail_name}; then
|
||||
if systemctl is-active --quiet systemd-nspawn@"${jail_name}"; then
|
||||
return=0
|
||||
fi
|
||||
exit "${return}"
|
||||
|
|
|
@ -17,4 +17,4 @@ jail_path=$(jail_path "${jail_name}")
|
|||
|
||||
test -d "${jail_path}" || error "${jail_name}: jail not found" 2
|
||||
|
||||
journalctl --reverse --unit systemd-nspawn@${jail_name}
|
||||
journalctl --reverse --unit systemd-nspawn@"${jail_name}"
|
||||
|
|
6
server/lib/bkctld-start
Normal file → Executable file
6
server/lib/bkctld-start
Normal file → Executable file
|
@ -24,19 +24,19 @@ test "$(get_jail_version "${jail_name}")" -ne "${CURRENT_JAIL_VERSION}" && error
|
|||
notice "Starting jail '${jail_name}'"
|
||||
systemctl start systemd-nspawn@"${jail_name}" || error "Failed to start nspawn container for jail '${jail_name}'"
|
||||
|
||||
if systemctl is-active --quiet systemd-nspawn@${jail_name}; then
|
||||
if systemctl is-active --quiet systemd-nspawn@"${jail_name}"; then
|
||||
port=$("${LIBDIR}/bkctld-port" "${jail_name}")
|
||||
success=1
|
||||
|
||||
for try in $(seq 1 10); do
|
||||
# Is the jail still running?
|
||||
if ! systemctl is-active --quiet systemd-nspawn@${jail_name}; then
|
||||
if ! systemctl is-active --quiet systemd-nspawn@"${jail_name}"; then
|
||||
printf 'x '
|
||||
break
|
||||
fi
|
||||
|
||||
# Is SSH alive and responding ?
|
||||
if /usr/lib/nagios/plugins/check_ssh --port=${port} localhost 2>&1 >/dev/null; then
|
||||
if /usr/lib/nagios/plugins/check_ssh --port="${port}" localhost >/dev/null 2>&1; then
|
||||
success=0
|
||||
break
|
||||
else
|
||||
|
|
2
server/lib/bkctld-status
Normal file → Executable file
2
server/lib/bkctld-status
Normal file → Executable file
|
@ -15,7 +15,7 @@ fi
|
|||
|
||||
test "$(get_jail_version "${jail_name}")" -ne "${CURRENT_JAIL_VERSION}" && error "${jail_name}: jail needs to be updated to version ${CURRENT_JAIL_VERSION} (currently $(get_jail_version "${jail_name}")) - Use bkctld convert-v2 <jail>" 3
|
||||
|
||||
incs_policy_file=$(current_jail_incs_policy_file ${jail_name})
|
||||
incs_policy_file=$(current_jail_incs_policy_file "${jail_name}")
|
||||
incs_policy="0"
|
||||
if [ -r "${incs_policy_file}" ]; then
|
||||
days=$(grep "^\+" "${incs_policy_file}" | grep --count "day")
|
||||
|
|
2
server/lib/bkctld-stop
Normal file → Executable file
2
server/lib/bkctld-stop
Normal file → Executable file
|
@ -20,7 +20,7 @@ test "$(get_jail_version "${jail_name}")" -ne "${CURRENT_JAIL_VERSION}" && error
|
|||
|
||||
"${LIBDIR}/bkctld-is-on" "${jail_name}" || exit 0
|
||||
|
||||
if systemctl stop systemd-nspawn@${jail_name}; then
|
||||
if systemctl stop systemd-nspawn@"${jail_name}"; then
|
||||
notice "Stopped jail '${jail_name}'"
|
||||
else
|
||||
error "Stop jail '${jail_name}' : failed"
|
||||
|
|
Loading…
Add table
Reference in a new issue