forked from safing/portmaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack
executable file
·62 lines (55 loc) · 1.04 KB
/
pack
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
baseDir="$( cd "$(dirname "$0")" && pwd )"
cd "$baseDir"
COL_OFF="\033[0m"
COL_BOLD="\033[01;01m"
COL_RED="\033[31m"
COL_GREEN="\033[32m"
COL_YELLOW="\033[33m"
function safe_execute {
echo -e "\n[....] $*"
$*
if [[ $? -eq 0 ]]; then
echo -e "[${COL_GREEN} OK ${COL_OFF}] $*"
else
echo -e "[${COL_RED}FAIL${COL_OFF}] $*" >/dev/stderr
echo -e "[${COL_RED}CRIT${COL_OFF}] ABORTING..." >/dev/stderr
exit 1
fi
}
function check {
./cmds/portmaster-core/pack check
./cmds/portmaster-start/pack check
}
function build {
safe_execute ./cmds/portmaster-core/pack build
safe_execute ./cmds/portmaster-start/pack build
}
function reset {
./cmds/portmaster-core/pack reset
./cmds/portmaster-start/pack reset
}
case $1 in
"check" )
check
;;
"build" )
build
;;
"reset" )
reset
;;
* )
echo ""
echo "build list:"
echo ""
check
echo ""
read -p "press [Enter] to start building" x
echo ""
build
echo ""
echo "finished building."
echo ""
;;
esac