Skip to content

Commit

Permalink
fix(scripts): wrong bash expansion
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Mar 22, 2023
1 parent f8ce80b commit 654a709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/scap-driver-loader.in
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ load_kernel_module_download() {
local URL=$(echo "${1}/${DRIVER_VERSION}/${ARCH}/${SYSDIG_KERNEL_MODULE_FILENAME}" | sed s/+/%2B/g)

echo "* Trying to download a prebuilt ${DRIVER_NAME} module from ${URL}"
if curl -L --create-dirs "${SYSDIG_DRIVER_CURL_OPTIONS}" -o "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${SYSDIG_KERNEL_MODULE_FILENAME}" "${URL}"; then
if curl -L --create-dirs ${SYSDIG_DRIVER_CURL_OPTIONS} -o "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${SYSDIG_KERNEL_MODULE_FILENAME}" "${URL}"; then
echo "* Download succeeded"
chcon -t modules_object_t "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${SYSDIG_KERNEL_MODULE_FILENAME}" > /dev/null 2>&1 || true
if insmod "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${SYSDIG_KERNEL_MODULE_FILENAME}"; then
Expand Down Expand Up @@ -501,7 +501,7 @@ load_bpf_probe_compile() {
mkdir -p /tmp/kernel
cd /tmp/kernel || exit
cd "$(mktemp -d -p /tmp/kernel)" || exit
if ! curl -L -o kernel-sources.tgz --create-dirs "${SYSDIG_DRIVER_CURL_OPTIONS}" "${BPF_KERNEL_SOURCES_URL}"; then
if ! curl -L -o kernel-sources.tgz --create-dirs ${SYSDIG_DRIVER_CURL_OPTIONS} "${BPF_KERNEL_SOURCES_URL}"; then
>&2 echo "Unable to download the kernel sources"
return
fi
Expand Down Expand Up @@ -543,7 +543,7 @@ load_bpf_probe_download() {

echo "* Trying to download a prebuilt eBPF probe from ${URL}"

if ! curl -L --create-dirs "${SYSDIG_DRIVER_CURL_OPTIONS}" -o "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${BPF_PROBE_FILENAME}" "${URL}"; then
if ! curl -L --create-dirs ${SYSDIG_DRIVER_CURL_OPTIONS} -o "${HOME}/.scap/${DRIVER_VERSION}/${ARCH}/${BPF_PROBE_FILENAME}" "${URL}"; then
>&2 echo "Unable to find a prebuilt ${DRIVER_NAME} eBPF probe"
return 1
fi
Expand Down

0 comments on commit 654a709

Please sign in to comment.