From c49112a28d3d1ec3db6eb37d5db94f3cd904c3a0 Mon Sep 17 00:00:00 2001 From: brent s Date: Mon, 9 Oct 2017 16:32:13 -0400 Subject: [PATCH] lol. forgot to actually call it. --- storage/badblocks.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/badblocks.py b/storage/badblocks.py index efe0a45..a290768 100755 --- a/storage/badblocks.py +++ b/storage/badblocks.py @@ -55,14 +55,15 @@ def chkDisk(disk): subprocess.run(c, stdout = DEVNULL) return() -def main(): - for d in getDisks(): - chkDisk(d) - def userChk(): # Needs to be run as root/with sudo, because of e.g. cryptsetup, etc. if os.geteuid() != 0: raise PermissionError('This script must be run with root privileges.') +def main(): + userChk() + for d in getDisks(): + chkDisk(d) + if __name__ == '__main__': main()