From 13077cb873f899f8b4beeb50bfd5261c4ba97d03 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 14 Mar 2015 14:50:39 +0000 Subject: [PATCH] git su user --- bin/nb-update | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/nb-update b/bin/nb-update index 6ca05645..79769140 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -28,12 +28,20 @@ for repo in \ /opt/backup_servers \ /etc/puppet/data \ /etc/puppet/modules \ + ~izideal \ ; do [ -d "$repo/.git" ] || continue cd "$repo" || continue - echo ">git pull $repo" - git pull + user=`ls -dl "$repo" |awk '{print $3}'` + echo ">git pull $repo (user=$user)" + + if [ "$USER" == "$user" ]; then + git pull + else + su - $user -c "git pull" + fi + done ##################################################################### -- 2.47.3