Skip to content
Snippets Groups Projects
Commit b3d2d8cd authored by Daniel Ehlers's avatar Daniel Ehlers
Browse files

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.
parent 80797fb6
No related branches found
No related tags found
No related merge requests found
#!/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}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment