AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 52.14.49.59


Current Path : /snap/lxd/31333/wrappers/
Upload File :
Current File : //snap/lxd/31333/wrappers/kmod

#!/bin/sh
NAME="$(basename "${0}")"

if [ "$(id -u)" != "0" ] && [ "${NAME}" = "modinfo" ]; then
    TMPDIR=$(mktemp -d)
    ln -s "/snap/core20/current/bin/kmod" "${TMPDIR}/modinfo"
    "${TMPDIR}/modinfo" "$@"
    RET=$?
    rm -Rf "${TMPDIR}"
    exit "${RET}"
fi

if [ "${NAME}" = "lsmod" ]; then
    exec "/snap/core20/current/bin/kmod" "list" "$@"
fi

for i in "/bin/${NAME}" "/sbin/${NAME}" "/usr/bin/${NAME}" "/usr/sbin/${NAME}"; do
    [ ! -e "/var/lib/snapd/hostfs/${i}" ] && continue

    # shellcheck disable=SC2093
    exec nsenter -t 1 -m "${i}" "$@"
done

echo "Unable to find ${NAME}" 1>&2
exit 1