summarylogtreecommitdiffstats
path: root/usbip-bind@.service
blob: 39784c2909669186b33c585e5828992de68450df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# /etc/systemd/system/usbip-bind@.service
[Unit]
Description=USB-IP Binding on bus id %I
After=network-online.target usbipd.service
Wants=network-online.target
Requires=usbipd.service

[Service]
Type=simple
EnvironmentFile=/etc/usbip/bind-devices/%i.conf
ExecStart=/bin/sh -c "/usr/bin/usbip bind -b $(/usr/bin/usbip list -p -l | grep '#usbid=${USBIP_DEVICE}#' | cut '-d#' -f1 | cut '-d=' -f2)"
RemainAfterExit=yes
ExecStop=/bin/sh -c "/usr/bin/usbip unbind -b $(/usr/bin/usbip list -p -l | grep '#usbid=${USBIP_DEVICE}#' | cut '-d#' -f1 | cut '-d=' -f2)"
Restart=on-failure

[Install]
WantedBy=multi-user.target