37 lines
1.0 KiB
Desktop File
Executable File
37 lines
1.0 KiB
Desktop File
Executable File
# $ cp -v ./qmi-network@.service /etc/systemd/system/
|
|
# $ systemctl daemon-reload
|
|
#
|
|
# $ systemctl enable --now qmi-network@0
|
|
#
|
|
# This will NOT work without a .network for your wwan device.
|
|
[Unit]
|
|
Description=qmi-network for cdc-wdm%i device
|
|
|
|
Before=freepbx.service
|
|
Before=asterisk.service
|
|
Before=sys-subsystem-net-devices-wg*.device
|
|
|
|
After=sys-subsystem-net-devices-wwan%i.device
|
|
Wants=sys-subsystem-net-devices-wwan%i.device
|
|
|
|
[Service]
|
|
Type=simple
|
|
Restart=always
|
|
TimeoutSec=240s
|
|
|
|
ExecStartPre=-qmi-network /dev/cdc-wdm%i stop
|
|
ExecStartPre=-rm /tmp/qmi-network-state-cdc-wdm%i
|
|
ExecStartPre=networkctl down wwan%i
|
|
ExecStartPre=sh -c "echo 'Y' | tee /sys/class/net/wwan%i/qmi/raw_ip"
|
|
ExecStartPre=qmi-network /dev/cdc-wdm%i start
|
|
ExecStartPre=networkctl up wwan%i
|
|
|
|
ExecStart=sh -e -c "sleep 30; while true; do ping -w 120 -I wwan%i -c 5 one.one.one.one || exit 1; sleep 300; done;"
|
|
|
|
ExecStop=-rm /tmp/qmi-network-state-cdc-wdm%i
|
|
ExecStop=networkctl down wwan%i
|
|
ExecStop=qmi-network /dev/cdc-wdm%i stop
|
|
|
|
[Install]
|
|
WantedBy=sys-subsystem-net-devices-wwan%i.device
|