fix ipfs init alone script

This commit is contained in:
poka 2020-06-06 00:14:13 +02:00
parent a5c9ac52ee
commit 61dfffbcab
1 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,9 @@
#!/bin/bash
# CHECK node IP isLAN?
myIP=$(hostname -I | awk '{print $1}')
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
# INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server