-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-to-download-server.sh
executable file
·55 lines (47 loc) · 1.49 KB
/
upload-to-download-server.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
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
usage()
{
echo "$(basename $0) [-d] [-p port ] [-v version ] upload"
echo ""
echo "-d dryrun"
echo "-p ssh port (default: $PORT)"
echo "-v version (e.g: 1.2-7e90273293649e046a67dbada9de629d)"
echo ""
echo "Example: $(basename $0) -p 2202 -v 1.2-7e90273293649e046a67dbada9de629d upload"
echo ""
}
TARGET="[email protected]:/var/www/files/server/packages"
PORT="2202"
VERSION=
CMD=
while getopts "hp:v:d" ARG
do
case "$ARG" in
h) usage; exit 1 ;;
p) PORT="${OPTARG}" ;;
v) VERSION="${OPTARG}" ;;
d) DRYRUN=echo ;;
\?) usage; exit 1 ;;
esac
done
shift $(( OPTIND - 1 ))
CMD="$1"
#echo "port: $PORT"
#echo "version: $VERSION"
#echo "cmd: $CMD"
if [ "$CMD" != "upload" -o -z "$VERSION" ]; then
echo "Error: missing command/parameters"
usage
exit 1
fi
if [ -z "${DRYRUN}" ]; then
echo "uploading packages/bmxd-${VERSION}-*"
else
echo "dryrun..."
fi
${DRYRUN} scp -P ${PORT} packages/bmxd-${VERSION}-debian-bullseye-amd64.deb ${TARGET}/debian11/
${DRYRUN} scp -P ${PORT} packages/bmxd-${VERSION}-debian-bookworm-amd64.deb ${TARGET}/debian12/
${DRYRUN} scp -P ${PORT} packages/bmxd-${VERSION}-ubuntu-focal-amd64.deb ${TARGET}/ubuntu20/
# ubuntu 22 nutzt die gleichen pakete wie ubuntu20, da es bei ubuntu22 compile fehler gibt
${DRYRUN} scp -P ${PORT} packages/bmxd-${VERSION}-ubuntu-focal-amd64.deb ${TARGET}/ubuntu22/bmxd-${VERSION}-ubuntu-jammy-amd64.deb
${DRYRUN} scp -P ${PORT} packages/bmxd-${VERSION}-ubuntu-noble-amd64.deb ${TARGET}/ubuntu24/