From 50e29d51f1df75482ab74f111790e14fc8e33af5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 10 Mar 2018 20:23:47 +0800 Subject: Improve error() and check_os() --- dfly-update | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dfly-update b/dfly-update index 66966e6..d13931c 100755 --- a/dfly-update +++ b/dfly-update @@ -57,14 +57,16 @@ warn() { } error() { + local ec="$1" + shift echo "ERROR: $@" >&2 + exit ${ec} } check_os() { local os=$(uname -s) if [ "${os}" != "DragonFly" ]; then - error "Not a DragonFly BSD system!" - exit ${EC_OS} + error ${EC_OS} "Not a DragonFly BSD system!" fi } -- cgit v1.2.2