Skip to content

Commit d147ecd

Browse files
committed
Move device-exists check to within the loop
This means the loop will start and run even if the device is not available, and the daemon will start when the device becomes available.
1 parent ec8b528 commit d147ecd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/start-xbee-daemon.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ if [ ! -d $BASE_DIR ] ; then
1414
exit 8
1515
fi
1616

17-
if [ ! -c $DEV ] ; then
18-
echo "No dev $DEV"
19-
exit 8
20-
fi
21-
2217
cd $BASE_DIR
2318

2419
while true ; do
20+
21+
if [ ! -c $DEV ] ; then
22+
echo "No dev $DEV"
23+
sleep 30
24+
continue
25+
fi
26+
2527
stty 9600 raw -echo < $DEV
2628

2729
bin/xbee-daemon.pl -d $DEV "[::]:7862"

0 commit comments

Comments
 (0)