Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update goreleaser and add postinstall script * remove a missing link
- Loading branch information
Showing
4 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# this post install script is used to count the number of installations of containerlab | ||
# when the installation is done via apt or yum package manager | ||
|
||
# exit if bash shell is not found | ||
if [ ! -e /bin/bash ]; then | ||
exit 0 | ||
fi | ||
|
||
# exit if no /etc/apt/sources.list.d/netdevops.list or /etc/yum.repos.d/yum.fury.io_netdevops_.repo is found | ||
if [ ! -e /etc/apt/sources.list.d/netdevops.list ] && [ ! -e /etc/yum.repos.d/yum.fury.io_netdevops_.repo ]; then | ||
exit 0 | ||
fi | ||
|
||
# run `containerlab version` and parse the version from the output | ||
version=$(containerlab version | awk '/version:/{print $2}') | ||
|
||
if [ -z "$version" ]; then | ||
exit 0 | ||
fi | ||
|
||
# prefixed with v | ||
rel_version=v${version} | ||
|
||
REPO_URL="https://github.com/srl-labs/containerlab/releases/download/${rel_version}/checksums.txt" | ||
|
||
if type "curl" &>/dev/null; then | ||
curl -sL -o /dev/null $REPO_URL || true | ||
exit 0 | ||
elif type "wget" &>/dev/null; then | ||
wget -q -O /dev/null $REPO_URL || true | ||
exit 0 | ||
fi |