Input password correctly
This commit is contained in:
parent
c721144f75
commit
e90661eeac
@ -3,7 +3,7 @@ import subprocess
|
|||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from . import config
|
import config
|
||||||
|
|
||||||
def log(*args, **kwargs):
|
def log(*args, **kwargs):
|
||||||
date = datetime.now().strftime('%d-%b-%Y %H:%M:%S')
|
date = datetime.now().strftime('%d-%b-%Y %H:%M:%S')
|
||||||
@ -16,11 +16,11 @@ if not os.path.exists(config.DISK):
|
|||||||
passwd = requests.get(config.PWD_URL).text
|
passwd = requests.get(config.PWD_URL).text
|
||||||
log("Got password :", passwd)
|
log("Got password :", passwd)
|
||||||
|
|
||||||
subprocess.call([
|
|
||||||
|
subprocess.run([
|
||||||
"cryptsetup", "luksOpen",
|
"cryptsetup", "luksOpen",
|
||||||
"--key-description", passwd,
|
|
||||||
config.DISK, "backup"
|
config.DISK, "backup"
|
||||||
])
|
], input=passwd, text=True)
|
||||||
|
|
||||||
subprocess.call([
|
subprocess.call([
|
||||||
"mount", "/dev/mapper/backup",
|
"mount", "/dev/mapper/backup",
|
||||||
|
Loading…
Reference in New Issue
Block a user