From: Nicolas Boisselier Date: Tue, 28 Jul 2015 19:42:05 +0000 (+0100) Subject: nb-update X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=d0e1dd6c03de84e3b08bb1a83e2a5cf1322699c5;p=nb.git nb-update --- diff --git a/bin/nb-update b/bin/nb-update index d756fd37..93b668c8 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -4,6 +4,8 @@ # Call by cron/etc/nb # ##################################################################### +#su nico -c "cd /opt/nb && git -C /opt/nb pull" +#exit . "${BASH_SOURCE%/*}/../etc/profile" || exit declare -r NAME="$(basename "${0}")" declare -r TMP="/tmp/$NAME.tmp" @@ -40,7 +42,7 @@ for repo in \ if [ "$USER" == "$user" ]; then timeout 30 git pull else - timeout 30 su $user -c "cd \"$repo\" && git pull" + timeout 30 su $user -c "GIT_SSH=$TMP cd \"$repo\" && git pull" fi ret=$? diff --git a/etc/bashrc.function b/etc/bashrc.function index b0ec6b54..2ec01783 100644 --- a/etc/bashrc.function +++ b/etc/bashrc.function @@ -5,7 +5,7 @@ ################################################################################# if ! which timeout 1>/dev/null; then timeout() { - perl -e 'alarm(shift @ARGV); exec @ARGV' -- $@ + perl -e 'BEGIN{$|=1}; alarm(shift @ARGV); exec join(" ",@ARGV)' -- $@ } fi