- added systemd service descriptors - new features in gpio_trigger.py: - support waiting for a hold period (-H) - added option to ignore command's result code (-i) - added variable subtitution in the arguments (%PIN% and %STATE%)
37 lines
1.5 KiB
Desktop File
37 lines
1.5 KiB
Desktop File
#
|
||
# rpi_no_usb.service – Systemd service to disable the Raspberry Pi's USB bus
|
||
#
|
||
# Version 1.0, latest version, documentation and bugtracker available at:
|
||
# https://gitlab.lindenaar.net/scripts/raspberrypi
|
||
#
|
||
# Copyright (c) 2019 Frederik Lindenaar
|
||
#
|
||
# This script is free software: you can redistribute and/or modify it under the
|
||
# terms of version 3 of the GNU General Public License as published by the Free
|
||
# Software Foundation, or (at your option) any later version of the license.
|
||
#
|
||
# This script is distributed in the hope that it will be useful but WITHOUT ANY
|
||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU General Public License along with
|
||
# this program. If not, visit <http://www.gnu.org/licenses/> to download it.
|
||
#
|
||
|
||
# To install copy to /etc/systemd/system/rpi_no_usb.service
|
||
# enable it to start during boot with: systemctl enable rpi_no_usb
|
||
# temporarily enable with: service rpi_no_usb start
|
||
# temporarily disable with: service rpi_no_usb stop
|
||
# disable starting during boot with: systemctl disable rpi_no_usb
|
||
|
||
[Unit]
|
||
Description=Disable Raspberry Pi USB bus
|
||
|
||
[Service]
|
||
Type=oneshot
|
||
ExecStart=/bin/sh -c "echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspower"
|
||
ExecStop=/bin/sh -c "echo 0x1 > /sys/devices/platform/soc/3f980000.usb/buspower"
|
||
RemainAfterExit=yes
|
||
|
||
[Install]
|
||
WantedBy=default.target |