mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 09:34:03 +08:00
iptb-lib: small cleanup
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This commit is contained in:
@ -3,16 +3,17 @@
|
||||
# Copyright (c) 2014, 2016 Jeromy Johnson, Christian Couder
|
||||
# MIT Licensed; see the LICENSE file in this repository.
|
||||
|
||||
export IPTB_ROOT="`pwd`/.iptb"
|
||||
export IPTB_ROOT="$(pwd)/.iptb"
|
||||
|
||||
ipfsi() {
|
||||
dir="$1"
|
||||
shift
|
||||
IPFS_PATH="$IPTB_ROOT/$dir" ipfs $@
|
||||
IPFS_PATH="$IPTB_ROOT/$dir" ipfs "$@"
|
||||
}
|
||||
|
||||
check_has_connection() {
|
||||
node=$1
|
||||
ipfsi $node swarm peers | grep ipfs > /dev/null
|
||||
node="$1"
|
||||
ipfsi "$node" swarm peers >"swarm_peers_$node" &&
|
||||
grep "ipfs" "swarm_peers_$node" >/dev/null
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user