diff options
-rwxr-xr-x | scripts/kvmd-udev-restart-pass | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/kvmd-udev-restart-pass b/scripts/kvmd-udev-restart-pass index 52e2c740..870896fa 100755 --- a/scripts/kvmd-udev-restart-pass +++ b/scripts/kvmd-udev-restart-pass @@ -40,14 +40,18 @@ test -n "$port" if [ "$port" = "HDMI-A-1" ]; then - if systemctl is-enabled -q kvmd-pass; then - status=$(head -n 1 "/sys/class/drm/$card-$port/status") - if [ "$status" = "connected" ]; then + status=$(head -n 1 "/sys/class/drm/$card-$port/status") + if [ "$status" = "connected" ]; then + if systemctl is-enabled -q kvmd-pass; then systemctl restart kvmd-pass || true pid=$(pidof ustreamer || echo 0) if [ "$pid" -ne 0 ]; then kill "$pid" || true fi fi + pid=$(pidof ustreamer || echo 0) + if [ "$pid" -ne 0 ]; then + kill "$pid" || true + fi fi fi |