]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #9882 About tapealert script issue on rhel8
authorEric Bollengier <eric@baculasystems.com>
Thu, 16 Feb 2023 14:45:48 +0000 (15:45 +0100)
committerEric Bollengier <eric@baculasystems.com>
Sat, 18 Feb 2023 09:21:25 +0000 (10:21 +0100)
Thanks Oliver Schonefeld

bacula/scripts/tapealert

index c8c68c0adbe0224efdf766cfb2f7765e7b3c4ba8..42a3dd4e16661d9488ba7411c5608f7113a0d469 100755 (executable)
@@ -34,13 +34,17 @@ fi
 
 
 if [ x$DEBUG = x ] ; then
-$tapeinfo -f $1 |grep "^TapeAlert" - |cut -b1-13
-exit $?
+out=`mktemp`
+$tapeinfo -f $1 >$out
+ret=$?
+awk '/^TapeAlert/ { $1=""; gsub(/^ */, "", $0); print $0 }' $out
+rm -f $out
+exit $ret
 
 else
 
 # For testing only
-cat <<EOF |grep "^TapeAlert" - |cut -b1-13
+cat <<EOF |grep "^TapeAlert" - | awk '/^TapeAlert/ { $1=""; gsub(/^ */, "", $0); print $0 }'
 Product Type: Tape Drive
 Vendor ID: 'IBM     '
 Product ID: 'ULTRIUM-TD6     '