From b3d2d8cd32514e905215bd6883b3b25842796942 Mon Sep 17 00:00:00 2001 From: Daniel Ehlers Date: Wed, 19 Mar 2014 20:54:47 +0100 Subject: [PATCH] gluon-autoupdater: Always allow forced autoupdate. On nodes with autoupdate disabled the cmdline parameter '-f' has no effect. But using the autoupdater for manual updates is quite handy. --- package/gluon-autoupdater/files/usr/sbin/autoupdater | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-autoupdater/files/usr/sbin/autoupdater b/package/gluon-autoupdater/files/usr/sbin/autoupdater index fc44d3c2..cd61eb49 100755 --- a/package/gluon-autoupdater/files/usr/sbin/autoupdater +++ b/package/gluon-autoupdater/files/usr/sbin/autoupdater @@ -1,15 +1,15 @@ #!/bin/sh -if test $(uci get autoupdater.settings.enabled) != 1; then - echo "autoupdater is disabled" - exit 0 -fi BRANCH=$(uci get autoupdater.settings.branch) PROBABILITY=$(uci get autoupdater.${BRANCH}.probability) if test "a$1" != "a-f"; then + if test $(uci get autoupdater.settings.enabled) != 1; then + echo "autoupdater is disabled" + exit 0 + fi # get one random byte from /dev/urandom, convert it to decimal and check # against update_probability*255 hexdump -n1 -e '/1 "%d"' /dev/urandom | awk "{exit \$1 > $PROBABILITY * 255}"