-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.sh
executable file
·45 lines (32 loc) · 1.12 KB
/
example.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/zsh
# Include our logging script
source ./includes/logging.sh
# Script entry (run as early as possible after include)
SCRIPTENTRY
#############################################################
# Dummy functions
#############################################################
function DIG_PIRATE_GOLD() {
ENTRY # We add "ENTRY" in top of every function
INFO "Digging for pirate gold..."
DEBUG "Searching on island: Hisingen"
sleep 2
WARN "This is taking a longer time than expected..."
SUCCESS "We successfully got some pirate gold!"
EXIT # We add "EXIT" in end of every function
}
function GET_HOSTNAME() {
ENTRY # We add "ENTRY" in top of every function
INFO "Getting hosting..."
INFO "Hostname is: $(hostname)"
EXIT # We add "EXIT" in end of every function
}
#############################################################
# Main script
#############################################################
INFO "Starting program"
DIG_PIRATE_GOLD
GET_HOSTNAME
ERROR "I'm done but I'm going to show an error instead"
# Script exit (run as late as possible in the script)
SCRIPTEXIT