%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/lxd/28373/wrappers/
Upload File :
Create Path :
Current File : //snap/lxd/28373/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

Zerion Mini Shell 1.0