File: docker-download.sh

package info (click to toggle)
ocsinventory-server 2.8.1%2Bdfsg1%2B~2.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 23,212 kB
  • sloc: javascript: 318,983; php: 29,162; perl: 8,925; sql: 5,101; xml: 2,902; sh: 1,662; python: 77; makefile: 29
file content (32 lines) | stat: -rwxr-xr-x 838 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

# Define constant
VERSION=$1

# Github base url for download releases
ReleaseBaseUrl="https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/"
# Last release tag
LastReleaseTag="${VERSION}/"
# Archive name
LastReleaseArchive="OCSNG_UNIX_SERVER_${VERSION}"
# Archive extension
ArchiveExtension=".tar.gz"
# File destination
FileDestination="/tmp/ocs"
# Archive link for release
FullArchiveUrl=$ReleaseBaseUrl$LastReleaseTag$LastReleaseArchive$ArchiveExtension

# Get archive

if wget $FullArchiveUrl; then
	echo $LastReleaseArchive
else
	LastReleaseArchive="OCSNG_UNIX_SERVER-${VERSION}"
	FullArchiveUrl=$ReleaseBaseUrl$LastReleaseTag$LastReleaseArchive$ArchiveExtension
	wget $FullArchiveUrl
	echo $FullArchiveUrl
fi

tar -xzvf $LastReleaseArchive$ArchiveExtension

mv $LastReleaseArchive $FileDestination