gracefully handle status check failure on ubuntu

This commit is contained in:
Jason Ertel
2024-03-07 12:31:51 -05:00
parent 1633527695
commit fffef9b621

View File

@@ -47,10 +47,14 @@ def check_for_fps():
fps = 1 fps = 1
except FileNotFoundError: except FileNotFoundError:
fn = '/proc/sys/crypto/' + feat_full + '_enabled' fn = '/proc/sys/crypto/' + feat_full + '_enabled'
with open(fn, 'r') as f: try:
contents = f.read() with open(fn, 'r') as f:
if '1' in contents: contents = f.read()
fps = 1 if '1' in contents:
fps = 1
except:
# Unknown, so assume 0
fps = 0
with open('/opt/so/log/sostatus/lks_enabled', 'w') as f: with open('/opt/so/log/sostatus/lks_enabled', 'w') as f:
f.write(str(fps)) f.write(str(fps))