1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
|
source /etc/conf.d/usbippolld |
|
tmp=/root/usbclients |
|
|
waitt=10 |
|
4 |
|
|
5 |
while true |
while true |
6 |
do |
do |
7 |
ALLCLIENTS=$(find ${tmp} -type f | sort) |
ALLCLIENTS=$(find ${USBIP_TEMP} -type f | sort) |
8 |
|
|
9 |
for i in ${ALLCLIENTS} |
for i in ${ALLCLIENTS} |
10 |
do |
do |
11 |
client=$(basename ${i} .txt) |
client=$(basename ${i} .txt) |
12 |
dev=$(< ${i}) |
dev=$(< ${i}) |
13 |
|
|
14 |
if fping -q -t50 ${client} |
if fping -q ${FPING_OPTS} ${client} |
15 |
then |
then |
16 |
echo "-- polling client ${client} on dev ${dev}" |
echo "-- polling client ${client} on dev ${dev}" |
17 |
usbip -a ${client} ${dev} |
usbip -a ${client} ${dev} |
25 |
rm ${tmp}/${client} |
rm ${tmp}/${client} |
26 |
fi |
fi |
27 |
|
|
28 |
sleep $waitt |
sleep ${USBIP_WAIT_TIMEOUT} |
29 |
done |
done |
30 |
done |
done |
|
|
|