changeset 248:0b5dbf394aa2

FIX: echo 2>&1 is not intended: use 1>&2 instead
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 11 Sep 2022 10:57:00 +0200
parents 5dd38cb3fecf
children a91e1c5173cc
files sbin/ftjail
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/ftjail	Sun Sep 11 10:18:15 2022 +0200
+++ b/sbin/ftjail	Sun Sep 11 10:57:00 2022 +0200
@@ -81,7 +81,7 @@
 
     while getopts ":" _opt ; do
         [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; }
-    done    
+    done
 }
 
 
@@ -90,7 +90,7 @@
 
     '
     local _mountpoint
-    
+
     local _ds _mount _rest
 
     _mountpoint="$1"
@@ -130,7 +130,7 @@
         esac
     done
     shift $((OPTIND-1))
-    OPTIND=1        
+    OPTIND=1
 
     _p_base="${1-}"
     _name="${2-}"
@@ -187,7 +187,7 @@
         esac
     done
     shift $((OPTIND-1))
-    OPTIND=1    
+    OPTIND=1
 
     _p_skel="${1-}"
     _name="${2-}"
@@ -403,7 +403,7 @@
                     #
                     if [ "${_mount_natural}" = "yes" ]; then
                         if [ "${_real_mp}" != "${_mp}" ]; then
-                            echo "ERROR: mountpoint mismatch" >&2
+                            echo "ERROR: mountpoint mismatch" 1>&2
                             return 1
                         fi
                     fi
@@ -418,7 +418,7 @@
                     fi
                     ;;
                 *)
-                    echo "Skipping ${_name} because its configured ZFS mountpoint is not relative to given root dataset" 2>&1
+                    echo "Skipping ${_name} because its configured ZFS mountpoint is not relative to given root dataset" 1>&2
                     ;;
             esac
         done
@@ -536,9 +536,9 @@
 
     _mountpoint="${1-}"
 
-    [ -z "${_mountpoint}" ] && { echo "ERROR: no mountpoint given" 2>&1; return 2; }
-    [ -d "${_mountpoint}" ] || { echo "ERROR: mountpoint \`${_mountpoint}' does not exist" 2>&1; return 1; }
-    [ -d "${_mountpoint}/skeleton" ] || { echo "WARNING: skeleton is not mounted at \`${_mountpoint}/skeleton'" 2>&1; }
+    [ -z "${_mountpoint}" ] && { echo "ERROR: no mountpoint given" 1>&2; return 2; }
+    [ -d "${_mountpoint}" ] || { echo "ERROR: mountpoint \`${_mountpoint}' does not exist" 1>&2; return 1; }
+    [ -d "${_mountpoint}/skeleton" ] || { echo "WARNING: skeleton is not mounted at \`${_mountpoint}/skeleton'" 1>&2; }
 
     for _dir in etc home root tmp usr/local var ; do
         case "${_dir}" in