aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-10 20:23:47 +0800
committerAaron LI <aly@aaronly.me>2018-03-10 20:23:47 +0800
commit50e29d51f1df75482ab74f111790e14fc8e33af5 (patch)
treec787b94543d0dd4f602fff4ca6398afadd64c003
parent03045b9ee9a30f120f0f48279eeef9463365a39a (diff)
downloaddfly-update-50e29d51f1df75482ab74f111790e14fc8e33af5.tar.bz2
Improve error() and check_os()
-rwxr-xr-xdfly-update6
1 files 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
}