added
This commit is contained in:
@@ -57,6 +57,17 @@ def create_scripts_startup(script_folder = str):
|
||||
else:
|
||||
return print(script_file, "erstellt",sep=" ")
|
||||
|
||||
def set_key_permission(key_liste = list):
|
||||
exist_dict = []
|
||||
for file in key_liste:
|
||||
status_file = str(oct(os.stat(file).st_mode)[-3:])
|
||||
if status_file != "600":
|
||||
os.chmod(path=file, mode=0o600)
|
||||
exist_dict.append({"file": file, "status": "berechtigung geändert"})
|
||||
else:
|
||||
exist_dict.append({"file": file, "status": "berechtigung sind richtig"})
|
||||
return exist_dict
|
||||
|
||||
|
||||
def main():
|
||||
kde_folders = [
|
||||
@@ -67,7 +78,10 @@ def main():
|
||||
|
||||
for test in create_folder(check_folders=kde_folders):
|
||||
print("Folder:" + test["name"] + " status: " + test["status"])
|
||||
#print(read_sshkeys(os.environ["HOME"] + "/.ssh"))
|
||||
|
||||
for permission in set_key_permission(read_sshkeys(os.environ["HOME"] + "/.ssh")):
|
||||
print("file: " + permission["file"] + " status: " + permission["status"])
|
||||
|
||||
create_ssh_script_addkey = create_scripts_addkeys(kde_folders[0], read_sshkeys(os.environ["HOME"] + "/.ssh") )
|
||||
create_ssh_script_shutdown = create_scripts_shutdown(script_folder=kde_folders[1])
|
||||
create_ssh_script_startup = create_scripts_startup(script_folder=kde_folders[2])
|
||||
|
||||
Reference in New Issue
Block a user