* remove buggy qmicli service (to be replaced)

* simplify and rename wifi power save service
This commit is contained in:
Mark 2022-03-25 19:01:56 +00:00
parent 8e26bcbcd4
commit 4ad9a095c9
4 changed files with 18 additions and 59 deletions

View File

@ -1,5 +1,5 @@
[Unit]
Description=mount sda1
Description=mnt-sda1
[Mount]
What=/dev/sda1

View File

@ -1,39 +0,0 @@
# Enable using systemctl enable --now qmicli@0 (where 0 = wwan0, 1 = wwan1 etc).
[Install]
WantedBy=multi-user.target
[Unit]
Description=Configure wwan%i device cdc-wdm using qmicli
Before=freepbx.service asterisk.service
After=sys-subsystem-net-devices-wwan%i.device
Wants=sys-subsystem-net-devices-wwan%i.device
[Service]
Type=forking
Restart=always
RestartSec=120s
TimeoutSec=240s
# Qmicli default args.
Environment=qmi="-p -d /dev/cdc-wdm%i"
# Name of the network device (as shown by networkctl) for the above.
Environment=dev_name="wwan%i"
# Stop the wwan device so we can reconfigure it correctly.
ExecStartPre=networkctl down $dev_name
# Set the correct data format.
ExecStartPre=sh -c "echo 'Y' | tee /sys/class/net/$dev_name/qmi/raw_ip"
# Enable auto-connect.
ExecStartPre=sh -c "qmicli $qmi --wds-set-autoconnect-settings=enabled,roaming-allowed || true"
# Get settings (starting the network).
ExecStartPre=sh -c "qmicli $qmi --wds-follow-network --wds-get-autoconnect-settings --client-no-release-cid || true"
# Bring up the network.
ExecStartPre=networkctl up $dev_name
# Main "process" to keep an eye on the network.
ExecStart=bash -e -c "while true; do ping -w 120 -I $dev_name -c 5 one.one.one.one || exit 1; sleep 300; done;"

View File

@ -0,0 +1,17 @@
# !! Requires a netdev configured to work
#
# $ cp -v ./wifi-power\@.service /etc/systemd/system/
# $ systemctl daemon-reload
#
#
# $ systemctl enable --now wifi-power@wlan0
[Unit]
Description=Toggle %i power saving
[Service]
Type=oneshot
ExecStart=iw %i set power_save on
ExecStop=iw %i set power_save off
[Install]
WantedBy=sys-subsystem-net-devices-%i.device

View File

@ -1,19 +0,0 @@
# !! Requires a systemd-network .network configured to work
# See wlan0-dhcp-default.network for details !!
#
# $ cp -v ./wlan0-powersaveoff.service /etc/systemd/system/
# $ systemctl daemon-reload
#
# Use systemctl edit --force --full wlan0-powersaveoff.service to edit
# the service to match your device/network! Then..
#
# $ systemctl enable --now wlan0-powersaveoff
[Unit]
Description=Disable wlan0 power saving
[Service]
Type=oneshot
ExecStart=iw wlan0 set power_save off
[Install]
WantedBy=sys-subsystem-net-devices-wlan0.device