From d0eee811291c5ad03ca74c141102e2035221260c Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 9 Dec 2019 20:54:53 -0700 Subject: [PATCH] Added unmount-backup-shares wrapper --- scripts/unmount-backup-shares | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/unmount-backup-shares diff --git a/scripts/unmount-backup-shares b/scripts/unmount-backup-shares new file mode 100755 index 00000000..a71a5c7b --- /dev/null +++ b/scripts/unmount-backup-shares @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""Wizard Kit: Unmount Backup Shares""" +# pylint: disable=invalid-name +# vim: sts=2 sw=2 ts=2 + +import wk + + +# Functions +def main(): + """Attempt to mount backup shares and print report.""" + wk.std.print_info('Unmounting Backup Shares') + report = wk.net.unmount_backup_shares() + for line in report: + color = 'GREEN' + line = f' {line}' + if 'Not mounted' in line: + color = 'YELLOW' + print(wk.std.color_string(line, color)) + + +if __name__ == '__main__': + try: + main() + except SystemExit: + raise + except: #pylint: disable=bare-except + wk.std.major_exception()