From 7e95c3b667a1b353f8275db886203f272bfcce34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 10 Feb 2021 13:52:52 -0500 Subject: first commit --- hyperterm/core/status.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hyperterm/core/status.sh (limited to 'hyperterm/core/status.sh') diff --git a/hyperterm/core/status.sh b/hyperterm/core/status.sh new file mode 100644 index 0000000..d5f5dc5 --- /dev/null +++ b/hyperterm/core/status.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# System Status +function exitstatus(){ + local retval=$? + unset status + + # Import colors + _colors_bash "$@" + + case $retval in + 0) + status="[${retval}]" + printf '%b%s' "${BOLD}${CYAN}" "${status}" + ;; + 1) + status="[${retval}]" + printf '%b%s' "${BOLD}${PURPLE}" "${status}" + ;; + *) + status="[${retval}]" + printf '%b%s' "${BOLD}${RED}" "${status}" + ;; + esac +} -- cgit v1.2.3