Skip to content

Commit 776f0ac

Browse files
committed
a script to help quickly sign the right things
1 parent 7ca2b51 commit 776f0ac

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

contrib/sign-profiles.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
PROFILE="$1"; shift
4+
PRIVATE_KEY="${1:-/etc/certs/private.key}"; shift
5+
OK=0
6+
7+
HUBBLE="${HUBBLE:-hubble}"
8+
9+
if [ -n "$PROFILE" -a -d "$PROFILE/hubblestack_pulsar" -a -d "$PROFILE/hubblestack_nova_profiles" ]
10+
then cd "$PROFILE" || exit 1; OK=1
11+
else read -ep "$PROFILE=\"$PROFILE\" doesn't look like profile repo, sign anyway? " YN
12+
if [[ "$YN" =~ [Yy] ]]
13+
then cd "$PROFILE" || exit 1; OK=1
14+
fi
15+
fi
16+
17+
if [ "X$OK" = X1 ]
18+
then readarray -t FILEZ < <( find ./ -name .git -prune -o \( -type f -print \) \
19+
| grep -vE '^(MANIFEST|SIGNATURE)$' )
20+
( set -x -e;
21+
cd "$PROFILE"
22+
"$HUBBLE" -vvv signing.msign "${FILEZ[@]}" private_key="$PRIVATE_KEY"
23+
)
24+
else "usage: $(basename "$0") profile-dir"
25+
fi

0 commit comments

Comments
 (0)