diff sbin/ftjail @ 537:62cd970aea9c

Replace the use of "deprecated" egrep calls with "grep -E"
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 09 Sep 2024 14:28:55 +0200
parents c615279bb797
children 566ecdd9e73b
line wrap: on
line diff
--- a/sbin/ftjail	Mon Sep 09 14:13:51 2024 +0200
+++ b/sbin/ftjail	Mon Sep 09 14:28:55 2024 +0200
@@ -538,7 +538,7 @@
         { echo "ERROR: dataset not found" >&2; return 1; }
 
     /sbin/mount -t zfs -p \
-    | grep -E "^${_dsname}(/|\s)" \
+    | /usr/bin/grep -E "^${_dsname}(/|\s)" \
     | sort -n -r \
     | {
         while IFS=' '$'\t' read -r _name _mp _rest ; do
@@ -940,12 +940,12 @@
     # Note that procstat places extra whitespace at the end of lines sometimes.
     #
     #
-    if procstat -a file | egrep '['$'\t '']+'"${_directory}"'(/|(['$'\t '']*)$)' ; then
+    if procstat -a file | /usr/bin/grep -E '['$'\t '']+'"${_directory}"'(/|(['$'\t '']*)$)' ; then
         echo "ERROR: There are open files within the jail" >&2
         return 1
     fi
     # The same for memory mappings
-    if procstat -a vm | egrep '['$'\t '']+'"${_directory}"'(/|(['$'\t '']*)$)' ; then
+    if procstat -a vm | /usr/bin/grep -E '['$'\t '']+'"${_directory}"'(/|(['$'\t '']*)$)' ; then
         echo "ERROR: There are open memory mappings within the jail" >&2
         return 1
     fi