Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
containerlab / .post-install
Size: Mime:
#!/bin/sh

# 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 sh shell is not found
if [ ! -e /bin/sh ]; 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 2>&1; then
    curl --max-time 2 -sL -o /dev/null "$REPO_URL" || true
    exit 0
elif type "wget" > /dev/null 2>&1; then
    wget -T 2 -q -O /dev/null "$REPO_URL" || true
    exit 0
fi