From bb8d1a1e040ed88438445b55922233fd173dd3bb Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 25 Nov 2021 09:09:05 +0100 Subject: [PATCH] net_qdisc_nfs_low: Abort on error Currently the script continues on errors. This has the problem, that the relevant first error message might be followed by less relevant following error messages: /usr/sbin/net_qdisc_nfs_low: line 3: /etc/local/mxhost.conf: Permission denied Cannot find device "root" Unknown qdisc "10:1", hence option "handle" is unparsable Unknown qdisc "10:2", hence option "handle" is unparsable Unknown qdisc "10:3", hence option "handle" is unparsable Unknown filter "10:", hence option "handle" is unparsable Unknown filter "10:", hence option "handle" is unparsable Unknown filter "10:", hence option "handle" is unparsable Unknown filter "10:", hence option "handle" is unparsable buczek@dose:~$ net_qdisc_nfs_low status /usr/sbin/net_qdisc_nfs_low: line 3: /etc/local/mxhost.conf: Permission denied Command line is not complete. Try option "help" Command line is not complete. Try option "help" Set the shell to -e so that we get only the first message and are sure we exit with a non-zero exit status on errors. --- net_qdisc_nfs_low/net_qdisc_nfs_low | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net_qdisc_nfs_low/net_qdisc_nfs_low b/net_qdisc_nfs_low/net_qdisc_nfs_low index 828d0b1..7033628 100755 --- a/net_qdisc_nfs_low/net_qdisc_nfs_low +++ b/net_qdisc_nfs_low/net_qdisc_nfs_low @@ -1,5 +1,7 @@ #! /bin/bash +set -e + . /etc/local/mxhost.conf case "$1" in