From 68fad03a6b98c48abf6cca05488998d7df872c7b Mon Sep 17 00:00:00 2001
From: Darko Poljak <darko.poljak@gmail.com>
Date: Fri, 5 Oct 2018 15:18:59 +0200
Subject: [PATCH] Fix SC2120, SC2119.

---
 cdist/conf/type/__jail_freebsd10/gencode-remote | 6 ++----
 cdist/conf/type/__jail_freebsd9/gencode-remote  | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/cdist/conf/type/__jail_freebsd10/gencode-remote b/cdist/conf/type/__jail_freebsd10/gencode-remote
index d01b30c6..230370c2 100755
--- a/cdist/conf/type/__jail_freebsd10/gencode-remote
+++ b/cdist/conf/type/__jail_freebsd10/gencode-remote
@@ -111,7 +111,6 @@ startJail() {
    fi
 }
 
-# shellcheck disable=SC2120
 deleteJail() {
 # Unmount the jail's mountpoints if necessary
    cat <<EOF
@@ -122,12 +121,12 @@ deleteJail() {
       output="\$(mount | grep "\/rw\/${name}\/")" || true
       if [ -n "\${output}" ]; then # >=1 rw mount is mounted still
          for DIR in "${output}"; do
-            umount -F "/etc/fstab.${name}" "\$(echo "${DIR}" | awk '{print $3}')"
+            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
@@ -348,7 +347,6 @@ if [ "$present" = "EXISTS" ]; then   # The jail currently exists
       exit 0
    else   # The jail is not supposed to exist
       stopJail
-      # shellcheck disable=SC2119
       deleteJail
       exit 0
    fi
diff --git a/cdist/conf/type/__jail_freebsd9/gencode-remote b/cdist/conf/type/__jail_freebsd9/gencode-remote
index e89672c2..13c237a9 100755
--- a/cdist/conf/type/__jail_freebsd9/gencode-remote
+++ b/cdist/conf/type/__jail_freebsd9/gencode-remote
@@ -116,7 +116,6 @@ startJail() {
    fi
 }
 
-# shellcheck disable=SC2120
 deleteJail() {
 # Unmount the jail's mountpoints if necessary
    cat <<EOF
@@ -127,12 +126,12 @@ deleteJail() {
       output="\$(mount | grep "\/rw\/${name}\/")" || true
       if [ -n "\${output}" ]; then # >=1 rw mount is mounted still
          for DIR in "${output}"; do
-            umount -F "/etc/fstab.${name}" "\$(echo "${DIR}" | awk '{print $3}')"
+            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
@@ -343,7 +342,6 @@ if [ "$present" = "EXISTS" ]; then   # The jail currently exists
       exit 0
    else   # The jail is not supposed to exist
       stopJail
-      # shellcheck disable=SC2119
       deleteJail
       exit 0
    fi