[Unit] Description=ModemManager sleep hook Before=sleep.target [Service] Type=oneshot ExecStart=/bin/systemctl stop ModemManager ExecStart=/bin/bash -c '/bin/echo 0 > /sys/bus/usb/devices/usb1/1-3/bConfigurationValue' ExecStop=/bin/sleep 3 ExecStop=/bin/bash -c '/bin/echo 1 > /sys/bus/usb/devices/usb1/1-3/bConfigurationValue' ExecStop=/bin/sleep 2 ExecStop=/bin/systemctl start ModemManager [Install] WantedBy=sleep.target