Last active
March 9, 2024 04:26
-
-
Save danny8376/24905d3ada81f4b5b1375c7792c59633 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
l="/ip4/127.0.0.1/tcp/5001" | |
c="/ip4/127.0.0.1/tcp/9095" | |
ipfs="/usr/bin/ipfs" | |
if [[ "$@" =~ "--api" ]]; then | |
$ipfs "$@" | |
elif [[ "$1" = "--local" || "$1" = "-L" ]]; then | |
shift | |
$ipfs --api "$l" "$@" | |
elif [[ "$1" = "--cluster" || "$1" = "-C" ]]; then | |
shift | |
$ipfs --api "$c" "$@" | |
else | |
$ipfs --api $l "$@" | |
#printf "Use cluster api? (Y/n)" | |
#read -n 1 A | |
#if [[ -n "$A" ]]; then echo ""; fi | |
#if [[ "$A" = "n" || "$A" = "N" ]]; then | |
# $ipfs --api $l "$@" | |
#else | |
# $ipfs --api $c "$@" | |
#fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment