Raspberry Service designen

Am Beispiel von WPA-Ping (wird von mir NICHT genutzt)

Das Script sieht so aus:

echo >> /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:

echo >> /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

Raspberry Service designen (zuletzt geƤndert am 2020-11-17 12:07:26 durch HansStefanSuhle)