diff --git a/cdist/conf/type/__git/explorer/group b/cdist/conf/type/__git/explorer/group deleted file mode 120000 index dcfd4bb5..00000000 --- a/cdist/conf/type/__git/explorer/group +++ /dev/null @@ -1 +0,0 @@ -owner \ No newline at end of file diff --git a/cdist/conf/type/__git/explorer/group b/cdist/conf/type/__git/explorer/group new file mode 100755 index 00000000..9803c085 --- /dev/null +++ b/cdist/conf/type/__git/explorer/group @@ -0,0 +1,6 @@ +#!/bin/sh + +destination="/$__object_id/.git" + +# See: cdist/conf/type/__file/explorer/stat +ls -ld "$destination" | awk '{ print $4 }' diff --git a/cdist/conf/type/__git/explorer/owner b/cdist/conf/type/__git/explorer/owner index 6187dd82..ea608c89 100755 --- a/cdist/conf/type/__git/explorer/owner +++ b/cdist/conf/type/__git/explorer/owner @@ -2,28 +2,5 @@ destination="/$__object_id/.git" -action="$(basename "${0}")" - -case $action in - owner) - bsd_fmt="%Su" - linux_fmt="%U" - ;; - group) - bsd_fmt="%Sg" - linux_fmt="%G" - ;; -esac - - -os="$(uname | tr '[:upper:]' '[:lower:]')" - -case $os in - *bsd) - # Checked on OpenBSD, FreeBSD and NetBSD - stat -f "${bsd_fmt}" "${destination}" 2>/dev/null || exit 0 - ;; - *) - stat --print "${linux_fmt}" "${destination}" 2>/dev/null || exit 0 - ;; -esac +# See: cdist/conf/type/__file/explorer/stat +ls -ld "$destination" | awk '{ print $3 }'