-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrr-flip-all
More file actions
46 lines (37 loc) · 725 Bytes
/
brr-flip-all
File metadata and controls
46 lines (37 loc) · 725 Bytes
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
#!/usr/bin/env bash
#
# Synopsis:
# Flip all active blob request logs across all schemas
# Exit Status:
# 0 ok
# 1 unexpected failure
#
PROG=$(basename $0)
SCHEMA=
log()
{
MSG=$@
test -n "$SCHEMA" && MSG="$SCHEMA: $MSG"
echo "$(date +'%Y/%m/%d %H:%M:%S'): $PROG: $MSG"
}
die()
{
log "ERROR: $@" >&2
exit 1
}
leave()
{
log 'good bye, cruel world'
}
log 'hello, world'
trap leave EXIT
test -n "$SETSPACE_ROOT" ||
die "environment variable not defined: SETSPACE_ROOT"
log "SETSPACE_ROOT=$SETSPACE_ROOT"
cd $SETSPACE_ROOT || die "cd $SETSPACE_ROOT failed"
. etc/profile
find-schema | while read SCHEMA; do
log "schema: $SCHEMA"
brr-flip $SCHEMA || die "brr-flip $SCHEMA failed: exit status=$?"
done
exit 0