udev-usb-sync/udev-usb-sync
Frede Hundewadt 664c6ab1d8 update script
2023-08-29 16:50:41 +02:00

26 lines
486 B
Bash
Executable file

#!/usr/bin/bash
#
# script to tweak USB storage device filesystem sync
#
# sources /etc/usb-dev-sync/usb-dev-sync.conf
#
use_tweaks=1
max_bytes=16777216
max_ration=50
strict_limit=1
# read user config
source /etc/udev-usb-sync/udev-usb-sync.conf
if [[ "$use_tweaks" = 0 ]]; then
exit 0
fi
if [[ -z "$1" ]]; then
exit 1
fi
echo "$max_bytes" > "/sys/block/$1/bdi/max_bytes"
echo "$max_ration" > "/sys/block/$1/bdi/max_ratio"
echo "$strict_limit" > "/sys/block/$1/bdi/strict_limit"