This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/mate-minidesktop in repository live-build-x2go. commit 712e5f8185bfe308e85cd841c845258bdc3b9a57 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jan 2 10:41:59 2017 +0100 added support for updatesleep parameter --- .../lib/live/config/2300-live-autoupdate | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate index 62afd3c..ee24683 100755 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate @@ -81,17 +81,22 @@ fi # sleeping a random amount of time to ease load on the update server # +MAXSLEEPTIME=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') +if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 120 ] ; then + MAXSLEEPTIME=900 +fi SLEEPTIME=0 -echo -n "Calculating random update delay (120-900 seconds)..." -while [ $SLEEPTIME -lt 120 ]; do - echo -n "." - # During startup, script is run with /bin/sh, - # even when #!/bin/bash is set, - # so we need to improvise. - RND=$(/bin/bash -c 'echo $RANDOM') - SLEEPTIME=$((RND%900)) -done -echo " " +echo "Calculating random update delay (120-$MAXSLEEPTIME seconds)..." +# During startup, script is run with /bin/sh, +# even when #!/bin/bash is set, +# so we need to improvise. +RND=$(/bin/bash -c 'echo $RANDOM') +SLEEPTIME=$((RND%MAXSLEEPTIME)) +if [ $SLEEPTIME -lt 120 ]; then + SLEEPTIME=$((SLEEPTIME+120)) +fi echo "Sleeping for $SLEEPTIME seconds ..." sleep $SLEEPTIME -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git