Input password correctly

This commit is contained in:
augustin64 2024-11-16 16:03:23 +01:00
parent c721144f75
commit e90661eeac

View File

@ -3,7 +3,7 @@ import subprocess
import requests
import os
from . import config
import config
def log(*args, **kwargs):
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
log("Got password :", passwd)
subprocess.call([
subprocess.run([
"cryptsetup", "luksOpen",
"--key-description", passwd,
config.DISK, "backup"
])
], input=passwd, text=True)
subprocess.call([
"mount", "/dev/mapper/backup",