mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
upgrades: Handle upgrade interval other than 1 day properly
- We must assume that apart from Plinth there will be user or user-agent changes to the configuration files. In this case the value may be set something other than '1' day.
This commit is contained in:
parent
d33e60c74a
commit
82fbbe1fec
@ -73,7 +73,13 @@ def subcommand_check_auto(_):
|
|||||||
arguments = ['apt-config', 'shell', 'UpdateInterval',
|
arguments = ['apt-config', 'shell', 'UpdateInterval',
|
||||||
'APT::Periodic::Update-Package-Lists']
|
'APT::Periodic::Update-Package-Lists']
|
||||||
output = subprocess.check_output(arguments).decode()
|
output = subprocess.check_output(arguments).decode()
|
||||||
print(bool(output and "1" in output))
|
|
||||||
|
update_interval = 0
|
||||||
|
match = re.match(r"UpdateInterval='(.*)'", output)
|
||||||
|
if match:
|
||||||
|
update_interval = int(match.group(1))
|
||||||
|
|
||||||
|
print(bool(update_interval))
|
||||||
|
|
||||||
|
|
||||||
def subcommand_enable_auto(_):
|
def subcommand_enable_auto(_):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user