added noerror function to execute stuff outside of error control system
This commit is contained in:
@@ -81,6 +81,20 @@ function backtrace
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Execute command outside of error control
|
||||
noerror()
|
||||
{
|
||||
set +o errexit
|
||||
trap - ERR
|
||||
|
||||
$@
|
||||
|
||||
trap "error ${LINENO}" ERR
|
||||
set -o errexit
|
||||
}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Test and exit if not root (or any UID 0 user)
|
||||
check_root()
|
||||
|
||||
Reference in New Issue
Block a user