STATION ONLINE or OFFLINE
This commit is contained in:
parent
448ef8a395
commit
83195a1d13
|
@ -221,13 +221,22 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do
|
||||||
ipfsid=$(echo $ipnslink | cut -d '/' -f 6)
|
ipfsid=$(echo $ipnslink | cut -d '/' -f 6)
|
||||||
mediakey=$(cat ~/.zen/PIN/${ipfsid}/MEDIAKEY)
|
mediakey=$(cat ~/.zen/PIN/${ipfsid}/MEDIAKEY)
|
||||||
|
|
||||||
[[ ! $(ipfs key list | grep ${mediakey}) ]] && echo "ERROR MISSING MEDIAKEY" && continue
|
[[ ! $(ipfs key list | grep ${mediakey}) ]] && echo "ERROR MISSING MEDIAKEY" && continue
|
||||||
|
|
||||||
## GET ACTUAL IPNS .chain VALUE
|
## GET ACTUAL IPNS .chain VALUE
|
||||||
actual=$(ipfs --timeout 12s cat /ipns/$ipnsid/.chain)
|
actual=$(ipfs --timeout 12s cat /ipns/$ipnsid/.chain)
|
||||||
## PUBLISH IT
|
## PUBLISH IT
|
||||||
[[ $actual ]] && ipfs --timeout 20s name publish -k ${mediakey} --quieter /ipfs/${actual}
|
if [[ $actual != "" ]]; then
|
||||||
echo "REFRESHED https://tube.copylaradio.com/ipns/$ipnsid TO /ipfs/$actual"
|
echo "${mediakey} : STATION DHT ONLINE"
|
||||||
|
ipfs --timeout 20s name publish -k ${mediakey} --quieter /ipfs/${actual}
|
||||||
|
echo "${actual}" > ~/.zen/PIN/$ipfsid/ACTUAL
|
||||||
|
else
|
||||||
|
echo "${mediakey} : STATION OFFLINE"
|
||||||
|
[[ -f ~/.zen/PIN/$ipfsid/ACTUAL ]] && actual=$(cat ~/.zen/PIN/$ipfsid/ACTUAL) || continue
|
||||||
|
ipfs --timeout 20s name publish -k ${mediakey} --quieter /ipfs/${actual}
|
||||||
|
fi
|
||||||
|
echo "PUBLISH https://tube.copylaradio.com/ipns/$ipnsid TO /ipfs/$actual"
|
||||||
|
actual=""
|
||||||
done
|
done
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
Loading…
Reference in New Issue