remove some old scripts
This commit is contained in:
parent
9c590635b6
commit
b1b8df7dd8
2 changed files with 0 additions and 87 deletions
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
from os import environ
|
||||
from os.path import abspath, isfile, join, relpath
|
||||
from sys import argv
|
||||
|
||||
from bundlewrap.repo import Repository
|
||||
|
||||
path = environ.get('BW_REPO_PATH', '.')
|
||||
repo = Repository(path)
|
||||
|
||||
if len(argv) < 3:
|
||||
print('Usage: {} <source> <target> [encryption key, default \'encrypt\']'.format(argv[0]))
|
||||
exit(1)
|
||||
|
||||
target = abspath(argv[2])
|
||||
datapath = join(abspath(path), 'data')
|
||||
|
||||
if not isfile(argv[1]):
|
||||
print('ERROR: Source file \'{}\' does not exist.'.format(argv[1]))
|
||||
exit(1)
|
||||
|
||||
if not target.endswith('.vault'):
|
||||
print('ERROR: Target file \'{}\' does not end in .vault'.format(argv[2]))
|
||||
exit(1)
|
||||
elif not target.startswith(datapath):
|
||||
print('ERROR: Target file \'{}\' is not in BW_REPO_PATH/data/'.format(argv[2]))
|
||||
exit(1)
|
||||
|
||||
if isfile(target):
|
||||
if input('ERROR: Target file \'{}\' already exists, overwrite? [yN]'.format(argv[2])) not in ['y', 'Y']:
|
||||
print('Abort')
|
||||
exit(2)
|
||||
|
||||
if len(argv) > 3:
|
||||
key = argv[3]
|
||||
else:
|
||||
key = 'encrypt'
|
||||
|
||||
repo.vault.encrypt_file(argv[1], relpath(target, start=datapath), key)
|
||||
|
||||
print('encryption successful')
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
from os import environ
|
||||
from sys import argv
|
||||
|
||||
from bundlewrap.repo import Repository
|
||||
from bundlewrap.utils.dicts import merge_dict
|
||||
|
||||
path = environ.get('BW_REPO_PATH', '.')
|
||||
repo = Repository(path)
|
||||
|
||||
|
||||
if len(argv) > 1:
|
||||
ips = {}
|
||||
for i in argv[1:]:
|
||||
ips = merge_dict(ips, repo.libs.tools.resolve_identifier(repo, i))
|
||||
else:
|
||||
ips = repo.libs.tools.resolve_identifier(repo, 'all')
|
||||
|
||||
|
||||
if ips['ipv4']:
|
||||
# editorconfig-checker-disable
|
||||
print(''' ________ __ __
|
||||
/ _/ __ \\_ __/ // /
|
||||
/ // /_/ / | / / // /_
|
||||
_/ // ____/| |/ /__ __/
|
||||
/___/_/ |___/ /_/''')
|
||||
# editorconfig-checker-enable
|
||||
|
||||
for ip in sorted(ips['ipv4']):
|
||||
print(ip)
|
||||
|
||||
if ips['ipv4'] and ips['ipv6']:
|
||||
# some space inbetween
|
||||
print()
|
||||
|
||||
if ips['ipv6']:
|
||||
# editorconfig-checker-disable
|
||||
print(''' ________ _____
|
||||
/ _/ __ \\_ __/ ___/
|
||||
/ // /_/ / | / / __ \\
|
||||
_/ // ____/| |/ / /_/ /
|
||||
/___/_/ |___/\\____/''')
|
||||
# editorconfig-checker-enable
|
||||
|
||||
for ip in sorted(ips['ipv6']):
|
||||
print(ip)
|
Loading…
Reference in a new issue