Update 99-usb-sync.rules

condition complete
This commit is contained in:
Grumpy Coder 2023-08-23 12:11:35 +00:00
parent f985c58c05
commit 541bc1b114

View file

@ -1,6 +1,6 @@
# rule to disable write cache for usb storage
# requires hdparm to be installed
ACTION=="add|change", KERNEL=="sd[a-z]", ENV{ID_USB_TYPE}=="disk", RUN+="[[ $(uname -r | awk -F'.' '{print $1 $2}') < 62 ]] && /usr/bin/hdparm -W 0 /dev/%K"
ACTION=="add|change", KERNEL=="sd[a-z]", ENV{ID_USB_TYPE}=="disk", RUN+="[[ $(uname -r | awk -F'.' '{print $1 $2}') < 62 ]] && [[ $(which hdparm) =~ (hdparm) ]] && && /usr/bin/hdparm -W 0 /dev/%K"
#
# rules to impose buffer limits on USB devices
# requires kernel > 6.1