HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc/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