aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/core/status.sh
blob: d5f5dc50461c867254618a976b41f902adec62bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
}