mirror of
https://github.com/cwinfo/hyperboria-nodedb
synced 2024-11-22 19:50:28 +00:00
a90a401a41
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
18 lines
292 B
Bash
Executable File
18 lines
292 B
Bash
Executable File
#!/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
|