From 3d7f08e43eb00ae1fcc5f604fc0f6abdbf285f67 Mon Sep 17 00:00:00 2001 From: Cuan Date: Wed, 2 Feb 2022 04:50:06 -0500 Subject: [PATCH] Added initial script for multi-client deletion --- bin/sshyp-shear.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/sshyp-shear.py diff --git a/bin/sshyp-shear.py b/bin/sshyp-shear.py new file mode 100755 index 0000000..4c16c4b --- /dev/null +++ b/bin/sshyp-shear.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +# external modules + +from os import remove, listdir +from os.path import expanduser + + +# utility functions + +def delete(_file_path, _client_device_name): + remove(f"{expanduser('~/.password-pasture/')}{_file_path}") + for _device_name in listdir(expanduser('~/.config/sshyp/devices')): + open(f"{expanduser('~/.config/sshyp/deleted/')}{_file_path}.{_device_name}.del", 'w') + remove(f"{expanduser('~/.config/sshyp/deleted/')}{_file_path}.{_client_device_name}.del")