myAstroKeyFile
This commit is contained in:
parent
6719bd92c7
commit
ba1800cc01
|
@ -170,9 +170,8 @@ echo "MY PLAYER API GW : $(myPlayerApiGw)"
|
||||||
NID="${myIPFS}"
|
NID="${myIPFS}"
|
||||||
WID="$(myPlayerApiGw)"
|
WID="$(myPlayerApiGw)"
|
||||||
|
|
||||||
####
|
#### player ipfs docker
|
||||||
[[ $USER == "zen" ]] \
|
[[ $USER == "zen" ]] && make player MAIL=$(myPlayer) USER_HOST=$(myPlayerHost)
|
||||||
&& make player MAIL=$PLAYER
|
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
|
|
64
tools/my.sh
64
tools/my.sh
|
@ -1,7 +1,11 @@
|
||||||
#shellcheck shell=sh disable=SC2034
|
#shellcheck shell=sh disable=SC2034
|
||||||
|
|
||||||
|
Base32Normalize() {
|
||||||
|
awk '{printf $0}' | basenc --base32 | Normalize
|
||||||
|
}
|
||||||
|
|
||||||
Normalize() {
|
Normalize() {
|
||||||
awk '{print tolower($1)}' | sed 's/\(_\|+\)/./g;'
|
awk '{print tolower($1)}' | sed 's/\(_\|+\)/./g; s/=//g;'
|
||||||
}
|
}
|
||||||
|
|
||||||
Revert() {
|
Revert() {
|
||||||
|
@ -10,8 +14,8 @@ Revert() {
|
||||||
|
|
||||||
isLan() {
|
isLan() {
|
||||||
local isLan=$(ip route |awk '$1 == "default" {print $3}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" \
|
local isLan=$(ip route |awk '$1 == "default" {print $3}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" \
|
||||||
|| route -n |awk '$1 == "0.0.0.0" {print $2}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" \
|
|| route -n |awk '$1 == "0.0.0.0" {print $2}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" \
|
||||||
|| true)
|
|| true)
|
||||||
[ -n "$isLan" ] && echo "$isLan" || true
|
[ -n "$isLan" ] && echo "$isLan" || true
|
||||||
} 2>/dev/null
|
} 2>/dev/null
|
||||||
|
|
||||||
|
@ -20,11 +24,26 @@ isPlayerLegal() {
|
||||||
[ -n "$isPlayerLegal" ] && echo "$isPlayerLegal" || true
|
[ -n "$isPlayerLegal" ] && echo "$isPlayerLegal" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myAstroFeedKey() {
|
||||||
|
local myAstroFeedKey=$(ipfs --api "$(myIpfsApi)" key list -l | awk '$2 == "'"$(myPlayerFeed)"'" {print $1}')
|
||||||
|
[ -n "$myAstroFeedKey" ] && echo "$myAstroFeedKey"
|
||||||
|
}
|
||||||
|
|
||||||
|
myAstroFeedKeyFile() {
|
||||||
|
local myAstroFeedKeyFile="$(myIpfsKeyStore)/key_$(myPlayerFeed | Base32Normalize)"
|
||||||
|
[ -f "$myAstroFeedKeyFile" ] && echo "$myAstroFeedKeyFile"
|
||||||
|
}
|
||||||
|
|
||||||
myAstroKey() {
|
myAstroKey() {
|
||||||
local myAstroKey=$(ipfs --api "$(myIpfsApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
|
local myAstroKey=$(ipfs --api "$(myIpfsApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
|
||||||
[ -n "$myAstroKey" ] && echo "$myAstroKey"
|
[ -n "$myAstroKey" ] && echo "$myAstroKey"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myAstroKeyFile() {
|
||||||
|
local myAstroKeyFile="$(myIpfsKeyStore)/key_$(myPlayer | Base32Normalize)"
|
||||||
|
[ -f "$myAstroKeyFile" ] && echo "$myAstroKeyFile"
|
||||||
|
}
|
||||||
|
|
||||||
myAstroPath() {
|
myAstroPath() {
|
||||||
local myAstroPath=$(cd ~/.zen/Astroport.ONE/ && pwd -P)
|
local myAstroPath=$(cd ~/.zen/Astroport.ONE/ && pwd -P)
|
||||||
[ -n "$myAstroPath" ] && echo "$myAstroPath"
|
[ -n "$myAstroPath" ] && echo "$myAstroPath"
|
||||||
|
@ -136,9 +155,9 @@ myIpfsKey() {
|
||||||
[ -n "$myIpfsKey" ] && echo "$myIpfsKey"
|
[ -n "$myIpfsKey" ] && echo "$myIpfsKey"
|
||||||
}
|
}
|
||||||
|
|
||||||
myIpfsKeystore() {
|
myIpfsKeyStore() {
|
||||||
local myIpfsKeystore=$(cd "$(myHome)"/.ipfs/keystore && pwd -P)
|
local myIpfsKeyStore=$(cd "$(myHome)"/.ipfs/keystore && pwd -P)
|
||||||
[ -n "$myIpfsKeystore" ] && echo "$myIpfsKeystore"
|
[ -n "$myIpfsKeyStore" ] && echo "$myIpfsKeyStore"
|
||||||
}
|
}
|
||||||
|
|
||||||
myIpfsPeerId() {
|
myIpfsPeerId() {
|
||||||
|
@ -183,11 +202,22 @@ myPlayerDomain() {
|
||||||
[ -n "$myPlayerDomain" ] && echo "$myPlayerDomain"
|
[ -n "$myPlayerDomain" ] && echo "$myPlayerDomain"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myPlayerFeed() {
|
||||||
|
[ -n "$(myPlayer)" ] \
|
||||||
|
&& local myPlayerFeed="$(myPlayer)_feed"
|
||||||
|
[ -n "$myPlayerFeed" ] && echo "$myPlayerFeed"
|
||||||
|
}
|
||||||
|
|
||||||
myPlayerFeedKey() {
|
myPlayerFeedKey() {
|
||||||
local myPlayerFeedKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayer)"'_feed" {print $1}')
|
local myPlayerFeedKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayerFeed)"'" {print $1}')
|
||||||
[ -n "$myPlayerFeedKey" ] && echo "$myPlayerFeedKey"
|
[ -n "$myPlayerFeedKey" ] && echo "$myPlayerFeedKey"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myPlayerFeedKeyFile() {
|
||||||
|
local myPlayerFeedKeyFile="$(myIpfsKeyStore)/key_$(myPlayerFeed | Base32Normalize)"
|
||||||
|
[ -f "$myPlayerFeedKeyFile" ] && echo "$myPlayerFeedKeyFile"
|
||||||
|
}
|
||||||
|
|
||||||
myPlayerG1Pub() {
|
myPlayerG1Pub() {
|
||||||
local myPlayerG1Pub=$(cat "$(myPlayerPath)"/.g1pub 2>/dev/null)
|
local myPlayerG1Pub=$(cat "$(myPlayerPath)"/.g1pub 2>/dev/null)
|
||||||
[ -n "$myPlayerG1Pub" ] && echo "$myPlayerG1Pub"
|
[ -n "$myPlayerG1Pub" ] && echo "$myPlayerG1Pub"
|
||||||
|
@ -199,14 +229,28 @@ myPlayerHome() {
|
||||||
[ -n "$myPlayerHome" ] && echo "$myPlayerHome"
|
[ -n "$myPlayerHome" ] && echo "$myPlayerHome"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myPlayerHost() {
|
||||||
|
[ -n "$(myReyalp)" ] \
|
||||||
|
&& { [ -n "$isLAN" ] \
|
||||||
|
&& local myPlayerHost="$(myHostName)" \
|
||||||
|
|| local myPlayerHost="$(myReyalp).$(myHostName)" \
|
||||||
|
;}
|
||||||
|
[ -n "$myPlayerHost" ] && echo "$myPlayerHost"
|
||||||
|
}
|
||||||
|
|
||||||
myPlayerKey() {
|
myPlayerKey() {
|
||||||
local myPlayerKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
|
local myPlayerKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
|
||||||
[ -n "$myPlayerKey" ] && echo "$myPlayerKey"
|
[ -n "$myPlayerKey" ] && echo "$myPlayerKey"
|
||||||
}
|
}
|
||||||
|
|
||||||
myPlayerKeystore() {
|
myPlayerKeyFile() {
|
||||||
local myPlayerKeystore=$(cd "$(myPlayerPath)"/.ipfs/keystore && pwd -P)
|
local myPlayerKeyFile="$(myPlayerKeyStore)/key_$(myPlayer | Base32Normalize)"
|
||||||
[ -n "$myPlayerKeystore" ] && echo "$myPlayerKeystore"
|
[ -f "$myPlayerKeyFile" ] && echo "$myPlayerKeyFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
myPlayerKeyStore() {
|
||||||
|
local myPlayerKeyStore=$(cd "$(myPlayerPath)"/.ipfs/keystore && pwd -P)
|
||||||
|
[ -n "$myPlayerKeyStore" ] && echo "$myPlayerKeyStore"
|
||||||
}
|
}
|
||||||
|
|
||||||
myPlayerNs() {
|
myPlayerNs() {
|
||||||
|
|
Loading…
Reference in New Issue