From 78fe5e43a1057af749a89b0acc1a23802c56363f Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Sun, 13 Jan 2013 20:50:04 +0800 Subject: [PATCH] cgminer: add both ft232 and pl2303 chip support on hotplug --- cgminer/files/20-cgminer.hotplug | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cgminer/files/20-cgminer.hotplug b/cgminer/files/20-cgminer.hotplug index 523defb..b84c321 100644 --- a/cgminer/files/20-cgminer.hotplug +++ b/cgminer/files/20-cgminer.hotplug @@ -2,12 +2,28 @@ # Copyright (C) 2012 Xiangfu (BTC: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q) -if [ "${PRODUCT}" = "67b/2303/400" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then +#FT232 +if [ "${PRODUCT}" = "403/6001/600" ] && [ "${INTERFACE}" = "255/255/255" ] && [ "$TYPE" = "0/0/0" ]; then case "$ACTION" in add) - killall -s 9 sleep killall -s 9 cgminer - sleep 30 && /etc/init.d/cgminer start & + ntpd -d -n -q -N -p 0.openwrt.pool.ntp.org \ + -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org && \ + /etc/init.d/cgminer start & + ;; + remove) + ;; + esac +fi + +#PL2303 +if [ "${PRODUCT}" = "67b/2303/400" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then + case "$ACTION" in + add) + killall -s 9 cgminer + ntpd -d -n -q -N -p 0.openwrt.pool.ntp.org \ + -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org && \ + /etc/init.d/cgminer start & ;; remove) ;;