srload: Cleanup when running outside buildtree

The original syntax did not work and the initial intention,
that root is always required is also false.
This commit is contained in:
Mattias Walström
2025-04-11 20:31:43 +02:00
parent cc03a59725
commit 028ab7c1f9
+1 -4
View File
@@ -14,10 +14,8 @@ source "$1"
# optional env variable override
if [ -n "$SYSREPOCTL_EXECUTABLE" ]; then
SYSREPOCTL="$SYSREPOCTL_EXECUTABLE"
elif [ "$(id -u)" -eq 0 ] && [ -n "$USER" ] && [ -n "$(command -v su)" ]; then
SYSREPOCTL=$(command sysrepoctl -l "$USER")
else
SYSREPOCTL=$(command sysrepoctl)
SYSREPOCTL=sysrepoctl
fi
PERMS="660"
@@ -91,7 +89,6 @@ enable()
fi
}
# Skip first 5 lines of header and last 3 lines of footer
SCTL_MODULES=$($SYSREPOCTL -l |tail -n +5 |head -n -3)