Größe: 1255
Kommentar:
|
Größe: 1332
Kommentar:
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 8: | Zeile 8: |
echo >> /usr/local/bin/wpaping << "EOFWPA" | cat >> /usr/local/bin/wpaping << "EOFWPA" |
Zeile 28: | Zeile 28: |
echo >> /lib/systemd/system/wpaping.service << "EOFWPA" | cat >> /lib/systemd/system/wpaping.service << "EOFWPA" |
Zeile 66: | Zeile 66: |
ExecStart=/home/hss/scripts/ | ExecStart=/home/hss/scripts/rsync-log-files-boot.sh ExecStop=/home/hss/scripts/rsync-log-files-shutdown.sh |
Raspberry Service designen
Am Beispiel von WPA-Ping (wird von mir NICHT genutzt)
Das Script sieht so aus:
cat >> /usr/local/bin/wpaping << "EOFWPA" #!/bin/bash # # Loop forever doing wpa_cli SCAN commands # sleeptime=120 # number of seconds to sleep. 2 minutes (120 seconds) is a good value while [ 1 ]; do wpa_cli -i wlan0 scan sleep $sleeptime done EOFWPA
Der Service selber wird so gestaltet:
cat >> /lib/systemd/system/wpaping.service << "EOFWPA" [Unit] Description=WPA Supplicant pinger Requires=network-online.target [Service] ExecStart=/usr/local/bin/wpaping User=root StandardInput=null StandardOutput=null StandardError=null Restart=on-failure [Install] WantedBy=multi-user.target EOFWPA
Um den Service dauerhaft zu starten, einfach den Standard-Weg beschreiten:
systemctl daemon-reload; systemctl enable wpaping.service; systemctl start wpaping.service
Runlevel herausfinden:
runlevel
Eigener Versuch:
[Unit] Description=Sync Logfiles between SD Card and ramdisk Requires=var-log.mount [Service] ExecStart=/home/hss/scripts/rsync-log-files-boot.sh ExecStop=/home/hss/scripts/rsync-log-files-shutdown.sh [Install] WantedBy=multi-user.target