#!/bin/bash

URL=https://github.com/libbpf/bpftool.git

cd $1
rm -rf bpftool
git clone --depth=1 ${URL}
cd bpftool
git fetch --depth=1 origin $2 || {
    echo "commit $2 does not exists in ${URL}"
    exit 1
}
git checkout $2
git submodule update --init --recursive
