format with blank and pylint
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
""" This Script encrypt Wireguardfiles for Wirepy users for more Security"""
|
||||
""" This Script encrypt Wireguardfiles for Wirepy users for more Security """
|
||||
|
||||
import os
|
||||
import shutil
|
||||
@ -8,12 +8,12 @@ from subprocess import check_call
|
||||
|
||||
uname = Path("/tmp/.loguser")
|
||||
|
||||
with open(uname, "r") as f:
|
||||
with open(uname, "r", encoding="utf-8") as f:
|
||||
logname = f.readline()
|
||||
|
||||
keyfile = Path(f"/home/{logname}/.config/wire_py/pbwgk.pem")
|
||||
dirname = Path("/tmp/tlecdcwg/")
|
||||
pkeyfile = "/usr/local/etc/ssl/pwgk.pem"
|
||||
PKEYFILE = "/usr/local/etc/ssl/pwgk.pem"
|
||||
|
||||
if not keyfile.is_file():
|
||||
|
||||
@ -22,7 +22,7 @@ if not keyfile.is_file():
|
||||
"openssl",
|
||||
"rsa",
|
||||
"-in",
|
||||
pkeyfile,
|
||||
PKEYFILE,
|
||||
"-out",
|
||||
keyfile,
|
||||
"-outform",
|
||||
@ -34,13 +34,13 @@ if not keyfile.is_file():
|
||||
|
||||
if dirname.exists():
|
||||
tl = os.listdir(str(dirname))
|
||||
cpth = str(keyfile)
|
||||
cryptfiles = cpth[:-9]
|
||||
CPTH = str(keyfile)
|
||||
CRYPTFILES = CPTH[:-9]
|
||||
|
||||
if keyfile.exists() and len(tl) != 0:
|
||||
for tunnels in tl:
|
||||
sourcetl = str(dirname) + "/" + tunnels
|
||||
tlname = cryptfiles + tunnels[:-5] + ".dat"
|
||||
tlname = CRYPTFILES + tunnels[:-5] + ".dat"
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
@ -60,13 +60,13 @@ else:
|
||||
|
||||
if dirname.exists():
|
||||
tl = os.listdir(str(dirname))
|
||||
cpth = str(keyfile)
|
||||
cryptfiles = cpth[:-9]
|
||||
CPTH = str(keyfile)
|
||||
CRYPTFILES = CPTH[:-9]
|
||||
|
||||
if keyfile.exists() and len(tl) != 0:
|
||||
for tunnels in tl:
|
||||
sourcetl = str(dirname) + "/" + tunnels
|
||||
tlname = cryptfiles + tunnels[:-5] + ".dat"
|
||||
tlname = CRYPTFILES + tunnels[:-5] + ".dat"
|
||||
check_call(
|
||||
[
|
||||
"openssl",
|
||||
|
Reference in New Issue
Block a user