You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
#!/usr/bin/python3
|
|
#Installationsskript für pi_watch.py
|
|
import toml
|
|
import os
|
|
import getpass
|
|
#Benutzereingaben abfragen
|
|
config = dict()
|
|
config["ip"] = input("IP Adresse eingeben: ")
|
|
config["port"] = int(input("Port: "))
|
|
config["user"] = input("Benutzername: ")
|
|
config["pw"] = getpass.getpass()
|
|
config["DB"] = input("Datenbankname: ")
|
|
config["record"] = input("Recordname: ")
|
|
config["intervall"] = float(input("Abfrageintervall in Sekunden eingeben: "))
|
|
eingabe = input("Netzwerkschnittstelle auswählen, Mehrfachnennung per , trennen: ")
|
|
config["netzwerk"] = eingabe.split(",")
|
|
config["name"] = input("Name für Tag eingeben: ")
|
|
config["nummer"] = input("Nummmer für Tag eingeben: ")
|
|
config["pi"] = input("0 für VServer, 1 für Pi eingeben: ")
|
|
print("Sollten Sie keine ssh_auth.toml Datei besitzen, und dem Paket liegt keine ssh_auth.py bei, bitte den Entwickler kontaktieren")
|
|
config["pfad_zu_ssh_auth"] = input("Pfad und Datei zu ssh_auth.toml: ")
|
|
#Eingaben im toml Format speichern
|
|
ausgabe = config
|
|
ausgabe = toml.dumps(ausgabe)
|
|
with open("conf.toml", "w") as file:
|
|
file.write(ausgabe)
|
|
print("Konfigurationsdatei erstellt, Einrichtung beendet")
|
|
|