git/client: Configure git only for real users
This commit is contained in:
parent
5a6da68f2f
commit
fd2ee25f29
2 changed files with 14 additions and 10 deletions
|
@ -1,6 +1,8 @@
|
||||||
if ( "`git config user.name`" == "" ) then
|
if ($uid > 3000 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then
|
||||||
|
if ( "`git config user.name`" == "" ) then
|
||||||
git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`"
|
git config --global user.name "`getent passwd '${USER}' | cut -d : -f 5`"
|
||||||
endif
|
endif
|
||||||
if ( "`git config user.email`" == "" ) then
|
if ( "`git config user.email`" == "" ) then
|
||||||
git config --global user.email "${USER}@{{ mail_domain }}"
|
git config --global user.email "${USER}@{{ mail_domain }}"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
if [ -z "$(git config user.name)" ]; then
|
if [ $UID -gt 3000 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
|
||||||
|
if [ -z "$(git config user.name)" ]; then
|
||||||
git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)"
|
git config --global user.name "$(getent passwd "$USER" | cut -d : -f 5)"
|
||||||
fi
|
fi
|
||||||
if [ -z "$(git config user.email)" ]; then
|
if [ -z "$(git config user.email)" ]; then
|
||||||
git config --global user.email "${USER}@{{ mail_domain }}"
|
git config --global user.email "${USER}@{{ mail_domain }}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue