Skip to content

Commit

Permalink
net_qdisc_nfs_low: Abort on error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Nov 25, 2021
1 parent e2029c3 commit bb8d1a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net_qdisc_nfs_low/net_qdisc_nfs_low
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! /bin/bash

set -e

. /etc/local/mxhost.conf

case "$1" in
Expand Down

0 comments on commit bb8d1a1

Please sign in to comment.