use command(1) to get executable's path
This commit is contained in:
parent
997fdd8ac4
commit
31e5c97c55
3 changed files with 9 additions and 6 deletions
|
@ -23,8 +23,9 @@
|
||||||
|
|
||||||
if [ -f "$__object/parameter/gid" ]; then
|
if [ -f "$__object/parameter/gid" ]; then
|
||||||
gid=$(cat "$__object/parameter/gid")
|
gid=$(cat "$__object/parameter/gid")
|
||||||
if [ -x /usr/bin/getent ] || [ -x /bin/getent ]; then
|
getent=$(command -v getent)
|
||||||
getent group "$gid" || true
|
if [ X != X"${getent}" ]; then
|
||||||
|
"${getent}" group "$gid" || true
|
||||||
elif [ -f /etc/group ]; then
|
elif [ -f /etc/group ]; then
|
||||||
grep -E "^(${gid}|([^:]+:){2}${gid}):" /etc/group || true
|
grep -E "^(${gid}|([^:]+:){2}${gid}):" /etc/group || true
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -23,8 +23,9 @@
|
||||||
|
|
||||||
name=$__object_id
|
name=$__object_id
|
||||||
|
|
||||||
if [ -x /usr/bin/getent ] || [ -x /bin/getent ]; then
|
getent=$(command -v getent)
|
||||||
getent passwd "$name" || true
|
if [ X != X"${getent}" ]; then
|
||||||
|
"${getent}" passwd "$name" || true
|
||||||
elif [ -f /etc/passwd ]; then
|
elif [ -f /etc/passwd ]; then
|
||||||
grep "^${name}:" /etc/passwd || true
|
grep "^${name}:" /etc/passwd || true
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,8 +31,9 @@ case "$os" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
if [ -x /usr/bin/getent ] || [ -x /bin/getent ]; then
|
getent=$(command -v getent)
|
||||||
getent "$database" "$name" || true
|
if [ X != X"${getent}" ]; then
|
||||||
|
"${getent}" "$database" "$name" || true
|
||||||
elif [ -f /etc/shadow ]; then
|
elif [ -f /etc/shadow ]; then
|
||||||
grep "^${name}:" /etc/shadow || true
|
grep "^${name}:" /etc/shadow || true
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue