~skiqqy/bin

ref: 8ecc22ceaf02ecaad3c432d7083882458da0e8c5 bin/import/alert.sh -rwxr-xr-x 466 bytes
8ecc22ceStephen Cochrane Progress on clip 9 months ago
                                                                                
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
26
27
#!/bin/bash
# Author: Skiqqy
# Simple error message script used by my other scripts
# USAGE: error "message" <exit_code>
RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[92m'
NC='\033[0m'

# Display an error message and exit.
# error [message] [exit code]
error () {
	printf "[${RED}ERROR${NC}] $1\n"
	exit $2
}

warning () {
	printf "[${YELLOW}WARNING${NC}] $1\n"
}

success () {
	printf "[${GREEN}SUCCESS${NC}] $1\n"
}

tick () {
	printf "$1 ${GREEN}${NC}\n"
}