diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-10 20:23:47 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-10 20:23:47 +0800 |
commit | 50e29d51f1df75482ab74f111790e14fc8e33af5 (patch) | |
tree | c787b94543d0dd4f602fff4ca6398afadd64c003 /dfly-update | |
parent | 03045b9ee9a30f120f0f48279eeef9463365a39a (diff) | |
download | dfly-update-50e29d51f1df75482ab74f111790e14fc8e33af5.tar.bz2 |
Improve error() and check_os()
Diffstat (limited to 'dfly-update')
-rwxr-xr-x | dfly-update | 6 |
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 } |