mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +01:00
bitwarden
This commit is contained in:
@@ -10,7 +10,7 @@ import json
|
|||||||
_DEST = "/share/Photo/imported"
|
_DEST = "/share/Photo/imported"
|
||||||
_DEV = ""
|
_DEV = ""
|
||||||
_DEV_MOUNT = "/share/external/DEV3304_1/"
|
_DEV_MOUNT = "/share/external/DEV3304_1/"
|
||||||
_DEV_DIR = "/share/external/DEV3304_1/DCIM/100GOPRO"
|
_DEV_DIR = "/share/external/DEV3304_1/DCIM/"
|
||||||
_IMP_FILE = "/share/external/DEV3304_1/auto_import"
|
_IMP_FILE = "/share/external/DEV3304_1/auto_import"
|
||||||
_DEV_DATA = "/share/external/DEV3304_1/MISC/version.txt"
|
_DEV_DATA = "/share/external/DEV3304_1/MISC/version.txt"
|
||||||
|
|
||||||
@@ -43,6 +43,9 @@ while True:
|
|||||||
if wifimac == "2474f742c017":
|
if wifimac == "2474f742c017":
|
||||||
_DEV = "gopro9_1"
|
_DEV = "gopro9_1"
|
||||||
print("gopro9_1 registered")
|
print("gopro9_1 registered")
|
||||||
|
elif wifimac == "2474f7421111":
|
||||||
|
_DEV = "dji_mini_4"
|
||||||
|
print("gopro9_1 registered")
|
||||||
|
|
||||||
if os.path.exists(_IMP_FILE) and _DEV == "":
|
if os.path.exists(_IMP_FILE) and _DEV == "":
|
||||||
print("path exist")
|
print("path exist")
|
||||||
@@ -65,33 +68,39 @@ while True:
|
|||||||
status, output = subprocess.getstatusoutput(myCmd)
|
status, output = subprocess.getstatusoutput(myCmd)
|
||||||
if not _DEV == "":
|
if not _DEV == "":
|
||||||
if os.path.exists(_DEV_DIR):
|
if os.path.exists(_DEV_DIR):
|
||||||
for filename in os.listdir(_DEV_DIR):
|
for file_or_dir in os.listdir(_DEV_DIR):
|
||||||
print(filename)
|
FULL_PATH = os.path.join(_DEV_DIR, file_or_dir)
|
||||||
c_time = os.path.getctime("{}/{}".format(_DEV_DIR,filename))
|
if os.path.isdir(FULL_PATH):
|
||||||
dt_c = datetime.datetime.fromtimestamp(c_time)
|
print(f"Folder: {file_or_dir}")
|
||||||
print(dt_c)
|
for filename in os.listdir(FULL_PATH):
|
||||||
_CDAT = dt_c.strftime("%Y-%m-%d")
|
print(filename)
|
||||||
print(_CDAT)
|
c_time = os.path.getctime("{}/{}".format(_DEV_DIR,filename))
|
||||||
_FDEST = "{}/{}/{}".format(_DEST,_DEV, _CDAT)
|
dt_c = datetime.datetime.fromtimestamp(c_time)
|
||||||
if not os.path.exists(_FDEST):
|
print(dt_c)
|
||||||
cmnd = "mkdir -p {}".format(_FDEST)
|
_CDAT = dt_c.strftime("%Y-%m-%d")
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
print(_CDAT)
|
||||||
print("Moving file {} into {}".format(filename, _FDEST))
|
_FDEST = "{}/{}/{}".format(_DEST,_DEV, _CDAT)
|
||||||
try:
|
if not os.path.exists(_FDEST):
|
||||||
shutil.move("{}/{}".format(_DEV_DIR,filename),_FDEST)
|
cmnd = "mkdir -p {}".format(_FDEST)
|
||||||
except:
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
try:
|
print("Moving file {} into {}".format(filename, _FDEST))
|
||||||
shutil.move("{}/{}".format(_DEV_DIR,filename),"{}/{}".format(_FDEST,filename))
|
try:
|
||||||
except:
|
shutil.move("{}/{}".format(_DEV_DIR,filename),_FDEST)
|
||||||
print("failed to move file {}".format(filename))
|
except:
|
||||||
print("Umounting")
|
try:
|
||||||
myCmd = "umount /share/external/DEV3304_1"
|
shutil.move("{}/{}".format(_DEV_DIR,filename),"{}/{}".format(_FDEST,filename))
|
||||||
status, output = subprocess.getstatusoutput(myCmd)
|
except:
|
||||||
print(output)
|
print("failed to move file {}".format(filename))
|
||||||
print(status)
|
print("Umounting")
|
||||||
myCmd = "/sbin/hal_app --se_buzzer enc_id=0,mode=100"
|
myCmd = "umount /share/external/DEV3304_1"
|
||||||
subprocess.getstatusoutput(myCmd)
|
status, output = subprocess.getstatusoutput(myCmd)
|
||||||
time.sleep(5)
|
print(output)
|
||||||
|
print(status)
|
||||||
|
myCmd = "/sbin/hal_app --se_buzzer enc_id=0,mode=100"
|
||||||
|
subprocess.getstatusoutput(myCmd)
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
print(f"File: {file_or_dir}")
|
||||||
else:
|
else:
|
||||||
print("Nothing to import")
|
print("Nothing to import")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ def check_and_write_cert_info(directory_path, output_json_path):
|
|||||||
rel_files.append(l[1].replace(";",""))
|
rel_files.append(l[1].replace(";",""))
|
||||||
if line == None:
|
if line == None:
|
||||||
print('no matches found')
|
print('no matches found')
|
||||||
print(rel_files)
|
#print(rel_files)
|
||||||
# fullchain_pem_files = [file for file in files if file.lower() == "fullchain.pem"]
|
# fullchain_pem_files = [file for file in files if file.lower() == "fullchain.pem"]
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ def check_and_write_cert_info(directory_path, output_json_path):
|
|||||||
|
|
||||||
fullchain_pem_file = fullchain_pem_file.replace("/data/","/share/docker_data/nginx/data/")
|
fullchain_pem_file = fullchain_pem_file.replace("/data/","/share/docker_data/nginx/data/")
|
||||||
fullchain_pem_file = fullchain_pem_file.replace("/etc/letsencrypt/","/share/docker_data/nginx/letsencrypt/")
|
fullchain_pem_file = fullchain_pem_file.replace("/etc/letsencrypt/","/share/docker_data/nginx/letsencrypt/")
|
||||||
print(f"Checking {fullchain_pem_file}")
|
#print(f"Checking {fullchain_pem_file}")
|
||||||
cert_info = get_cert_info(fullchain_pem_file)
|
cert_info = get_cert_info(fullchain_pem_file)
|
||||||
|
|
||||||
if cert_info:
|
if cert_info:
|
||||||
|
|||||||
Reference in New Issue
Block a user