Hilfsskript zum erstellen aller notwendigen Skripte und Einrichtung zum Einhängen von Netzwerkfreigaben nach der Tutorialanleitung im Raspberry Pi Forum.
Hier das Ein/Ausgabeprotokoll (script wurde mit sudo ausgeführt)
create_automount-master
dhcpcd-pi
pulse-PKdhtXMmr18n
ssh-l8Q9h0VaSyao
ssh-Nx4PZ1VQgSX7
ssh-Y9XlO9CHE7mB
ssh-yiwqG1LT78oP
systemd-private-d774862cc47540cda4ab8498c680417f-rtkit-daemon.service-wAxAhV
systemd-private-d774862cc47540cda4ab8498c680417f-systemd-timesyncd.service-Xlh0TQ
root@raspberrypi:/tmp# cd cr*
root@raspberrypi:/tmp/create_automount-master# ls
create_auto_mount.py LICENSE ping_server.py README.md requirements.txt
root@raspberrypi:/tmp/create_automount-master# pip3 install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting toml (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl
Installing collected packages: toml
Successfully installed toml-0.10.2
root@raspberrypi:/tmp/create_automount-master# python3 create_auto_mount.py
Dieses Skript soll die Einrichtung zum Einhängen von Netzwerkfreigaben beschleunigen.
Es kann nicht das notwendige Wissen zu den einzelnen Punkten während der Erstellung ersetzen.
Verwendung und Benutzung auf eigene Gefahr!
Name für neuen Mountordner: FritzNas
Verzeichnis für den Mountordner, wenn leer: -> /media
Zugangsdaten für das einzuhängende Gerät - Zugang muss am anderen Gerät freigeben/erstellt werden.
Benutzername: nasuser
Passwort:
Externe Adresse eingeben: 192.168.178.1
uid: Bsp. '1000':
gid: Bsp. '1000': 1000
Weitere Optionen eingeben - Bsp: vers=1.0, weiter mit leerer Eingabe: vers=1.0
Weitere Optionen eingeben - Bsp: vers=1.0, weiter mit leerer Eingabe:
IP Pingziel zur Überprüfung der Netwerkverfügbarkeit eingeben: 192.168.178.1
Die Konfigruationsdatei enthält wenn sie gespeichert wird alle Eingaben einschließlich Passwörter in Klartext!
Eingaben sichern? (j|n)j
Configname eingeben: nasconfig
Datei /tmp/create_automount-master/nasconfig_cfg.toml erstellt
Ordner /media/FritzNas erstellt
Zugangsdaten erstellt - Pfad: /etc/smbcredentials
Datei /etc/systemd/system/media-FritzNas.mount erstellt
Datei /usr/local/sbin/ping_server.py erstellt
Datei /etc/systemd/system/ping_server.service erstellt
Job for media-FritzNas.mount failed.
See "systemctl status media-FritzNas.mount" and "journalctl -xe" for details.
b''
Unit aktivieren? (j|n)j
Created symlink /etc/systemd/system/multi-user.target.wants/media-FritzNas.mount → /etc/systemd/system/media-FritzNas.mount.
b''
root@raspberrypi:/tmp/create_automount-master# systemctl status media-FritzNas.mount
● media-FritzNas.mount - Mount von /media/FritzNas
Loaded: loaded (/etc/systemd/system/media-FritzNas.mount; enabled; vendor pre
Active: failed (Result: exit-code) since Thu 2021-09-16 09:46:45 CEST; 54s ag
Where: /media/FritzNas
What: 192.168.178.1
Sep 16 09:46:45 raspberrypi systemd[1]: Mounting Mount von /media/FritzNas...
Sep 16 09:46:45 raspberrypi mount[1635]: mount: /media/FritzNas: failed to parse
Sep 16 09:46:45 raspberrypi systemd[1]: media-FritzNas.mount: Mount process exit
Sep 16 09:46:45 raspberrypi systemd[1]: media-FritzNas.mount: Failed with result
Sep 16 09:46:45 raspberrypi systemd[1]: Failed to mount Mount von /media/FritzNa
lines 1-11/11 (END)