Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Klice/7f55bf81f4332fee1a344f658df9d6fd to your computer and use it in GitHub Desktop.
Save Klice/7f55bf81f4332fee1a344f658df9d6fd to your computer and use it in GitHub Desktop.
~# cat /etc/udev/rules.d/90-rtl.rules
ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", TAG+="systemd", RUN+="/bin/systemctl --no-block restart rtl_tcp.service"
~# cat /etc/systemd/system/rtl_tcp.service
[Unit]
Description=RTL TCP service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/rtl_tcp -a 0.0.0.0 &
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rtl_tcp
KillSignal=SIGKILL
[Install]
WantedBy=multi-user.target
~# udevadm control --reload-rules
~# systemctl daemon-reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment