-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathpack.sh
More file actions
executable file
·36 lines (32 loc) · 811 Bytes
/
pack.sh
File metadata and controls
executable file
·36 lines (32 loc) · 811 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
#!/bin/sh -e
cd "$(dirname "$0")"
display_usage() {
echo "Usage:\n$0 [version]"
}
# check whether user had supplied -h or --help . If yes display usage
if [ $# = "--help" ] || [ $# = "-h" ]
then
display_usage
exit 0
fi
# check number of arguments
if [ $# -ne 1 ]
then
display_usage
exit 1
fi
for GOOS in linux; do
for GOARCH in amd64 arm64 mips64 mips64le ppc64 ppc64le riscv64; do
echo "packing $GOOS/$GOARCH" >&2
export GOOS="$GOOS"
export GOARCH="$GOARCH"
./build.sh
rm -f fixuid-*"-$GOOS-$GOARCH.tar.gz"
perm="$(id -u):$(id -g)"
sudo chown root:root fixuid
sudo chmod u+s fixuid
tar -cvzf "fixuid-$1-$GOOS-$GOARCH.tar.gz" fixuid
sudo chmod u-s fixuid
sudo chown "$perm" fixuid
done
done