Skip to content

Commit

Permalink
improved emonpi_auto_add_nodes script implementation thanks to @borpin
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Jun 12, 2020
1 parent da27a4a commit 14c774c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conf/nodes/emonpi_auto_add_nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ fi
max=31
for var in `seq 2 $max`
do
if ! grep "\[$var\]" $emonhub_location; then
if grep "^\[\[$var\]\]" $emonhub_location; then
echo "Node $var already present"
else
if [ -f $path/$var ]; then
echo "">>$emonhub_location
cat $path/$var >> $emonhub_location
echo "Added node $var to emonhub.conf"
fi
else
echo "Node $var already present"
fi
done

0 comments on commit 14c774c

Please sign in to comment.