From a90a401a41a578c6d6963cecc9dd895dececc8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 18 Sep 2015 20:09:38 +0200 Subject: [PATCH] Made simple script to add nodes correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ɓukasz Magiera --- addnode.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 addnode.sh diff --git a/addnode.sh b/addnode.sh new file mode 100755 index 0000000..5484477 --- /dev/null +++ b/addnode.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +NODEFILE=nodes + +if [ "$#" -ne 2 ]; then + echo -e "Usage:\n\t./addnode.sh IPv6 name [name] ..." + exit 1 +fi + +if grep --quiet $1 $NODEFILE; then + echo "Node IP is already on the list, please edit manually" + exit 1 +fi + +echo "$@" >> $NODEFILE + +sort $NODEFILE -o $NODEFILE