aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/core/status.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
committerJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
commit7e95c3b667a1b353f8275db886203f272bfcce34 (patch)
treeaefe3b7db69ac78b83b79a70cf43401679812d20 /hyperterm/core/status.sh
downloadhyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.lz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.xz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.zip
first commit
Diffstat (limited to 'hyperterm/core/status.sh')
-rw-r--r--hyperterm/core/status.sh25
1 files changed, 25 insertions, 0 deletions
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
+}