File: //usr/share/init/usbipd.conf
description "USB over IP daemon"
author "System Integration Team"
console log
reload signal SIGUSR1
expect fork
respawn
respawn limit 5 10
pre-start script
PRINTER_NUM=`synoprint --list | wc -l` || true
KERNEL_VERSION=`uname -r` || true
NUMKO=`lsmod | grep -E ^usbip | wc -l` || true
case "$KERNEL_VERSION" in
"3.10."* | "3.6."* | "4.4."*)
USBIP_KO=/lib/modules/usbip-host.ko || true
USBIP_COMMON_MOD_KO=/lib/modules/usbip-core.ko || true
;;
*)
USBIP_KO=/lib/modules/usbip.ko || true
USBIP_COMMON_MOD_KO=/lib/modules/usbip_common_mod.ko || true
;;
esac
if [ ${PRINTER_NUM} -eq 0 ]; then
/sbin/rmmod ${USBIP_KO} || true
/sbin/rmmod ${USBIP_COMMON_MOD_KO} || true
stop; exit 0
fi
if [ ${NUMKO} -ne 2 ]; then
/sbin/insmod ${USBIP_COMMON_MOD_KO}
/sbin/insmod ${USBIP_KO}
fi
end script
exec /usr/bin/usbipd -D