Ну, не знаю, попробуйте такой костыль...
Создать файл usbreset.c со следующим содержимым:

usbreset.c
/* usbreset -- send a USB port reset to a USB device */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
int main(int argc, char **argv)
{
const char *filename;
int fd;
int rc;
if (argc != 2) {
fprintf(stderr, "Usage: usbreset device-filename\n");
return 1;
}
filename = argv[1];
fd = open(filename, O_WRONLY);
if (fd < 0) {
perror("Error opening output file");
return 1;
}
printf("Resetting USB device %s\n", filename);
rc = ioctl(fd, USBDEVFS_RESET, 0);
if (rc < 0) {
perror("Error in ioctl");
return 1;
}
printf("Reset successful\n");
close(fd);
return 0;
}
Скомпилировать :
# cc usbreset.c -o usbreset ,
скопировать в /usr/bin/, сделать исполняемым:
# sudo chmod +x /usr/bin/usbreset Создать скрипт:
- Код: Выделить всё
#!/bin/bash
bus=$(lsusb | grep Xbox360 | gawk '{print $2}')
port=$(lsusb | grep Xbox360 | gawk '{print $4}' | cut -d":" -f1)
usbreset /dev/bus/usb/$bus/$port
сделать исполняемым.
Запускать на старте через systemd- создать файл /etc/systemd/system/myscript.service:
- Код: Выделить всё
[Unit]
Description=My script
[Service]
Type=oneshot
User=root
Group=root
ExecStart=/usr/bin/my-script
[Install]
WantedBy=multi-user.target
А можно и вручную запускать. Или прописать на старте игрушки. Но тогда пароль будет просить.