Fix SC2154. Note: ignoring __<name> vars.

This commit is contained in:
Darko Poljak 2018-10-06 13:59:47 +02:00
parent a9f27beb98
commit a78baccc82
7 changed files with 10 additions and 9 deletions

View file

@ -120,13 +120,13 @@ deleteJail() {
fi
output="\$(mount | grep "\\/rw\\/${name}\\/")" || true
if [ -n "\${output}" ]; then # >=1 rw mount is mounted still
for DIR in "${output}"; do
for DIR in "\${output}"; do
umount -F "/etc/fstab.${name}" "\$(echo "${DIR}" | awk '{print \$3}')"
done
fi
output="\$(mount | grep "\\/${name} (")" || true
if [ -n "\${output}" ]; then # ro mount is mounted still
umount -F "/etc/fstab.${name}" "\$(echo "${output}" | awk '{print \$3}')"
umount -F "/etc/fstab.${name}" "\$(echo "\${output}" | awk '{print \$3}')"
fi
EOF
# Remove the jail's rw mountpoints

View file

@ -125,13 +125,13 @@ deleteJail() {
fi
output="\$(mount | grep "\\/rw\\/${name}\\/")" || true
if [ -n "\${output}" ]; then # >=1 rw mount is mounted still
for DIR in "${output}"; do
for DIR in "\${output}"; do
umount -F "/etc/fstab.${name}" "\$(echo "${DIR}" | awk '{print \$3}')"
done
fi
output="\$(mount | grep "\\/${name} (")" || true
if [ -n "\${output}" ]; then # ro mount is mounted still
umount -F "/etc/fstab.${name}" "\$(echo "${output}" | awk '{print \$3}')"
umount -F "/etc/fstab.${name}" "\$(echo "\${output}" | awk '{print \$3}')"
fi
EOF
# Remove the jail's rw mountpoints

View file

@ -51,7 +51,7 @@ case "$state_should" in
echo "opkg --verbosity=0 remove '$name'"
;;
*)
echo "Unknown state: $state" >&2
echo "Unknown state: ${state_should}" >&2
exit 1
;;
esac

View file

@ -69,10 +69,10 @@ fi
if [ -n "${cksum}" ]; then
if [ ! "\${currentSum}" = "${cksum}" ]; then
$__remote_copy "${source}" "${my_target_host}:${rcvar}.new"
$__remote_copy "${source}" "\${my_target_host}:${rcvar}.new"
fi
else # File just doesn't exist yet
$__remote_copy "${source}" "${my_target_host}:${rcvar}.new"
$__remote_copy "${source}" "\${my_target_host}:${rcvar}.new"
fi
EOF

View file

@ -33,7 +33,7 @@ case "$state_should" in
echo "su - postgres -c 'psql -c \"$cmd\" \"$dbname\"'"
;;
absent)
cmd="DROP EXTENSION IF EXISTS $extenstion"
cmd="DROP EXTENSION IF EXISTS $extension"
echo "su - postgres -c 'psql -c \"$cmd\" \"$dbname\"'"
;;
esac

View file

@ -52,6 +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}"
fi
echo "stopped" >> "$__messages_out"

View file

@ -76,7 +76,7 @@ case "$state_should" in
echo "zypper $zypper_def_opts ref"
;;
absent)
echo "zypper $zypper_def_opts removeservice $service_id"
echo "zypper $zypper_def_opts removeservice $exp_id"
echo "zypper $zypper_def_opts refs"
echo "zypper $zypper_def_opts ref"
;;