Add fine-grain ssb initialization (profile URLs) #12
|
@ -7,6 +7,22 @@
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
ME="${0##*/}"
|
ME="${0##*/}"
|
||||||
|
|
||||||
|
nodename=""
|
||||||
|
localname=""
|
||||||
|
localport=""
|
||||||
|
scheme=""
|
||||||
|
# Options.
|
||||||
|
while getopts ":n:l:p:s:" option; do
|
||||||
|
case "$option" in
|
||||||
|
n) nodename=$OPTARG ;;
|
||||||
|
l) localname=$OPTARG ;;
|
||||||
|
p) localport=$OPTARG ;;
|
||||||
|
s) scheme=$OPTARG ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
########################################################################
|
########################################################################
|
||||||
# \\///
|
# \\///
|
||||||
|
@ -35,14 +51,14 @@ echo '
|
||||||
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_info
|
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_info
|
||||||
########################################################################
|
########################################################################
|
||||||
ipfsnodeid=$(ipfs id -f='<id>\n')
|
ipfsnodeid=$(ipfs id -f='<id>\n')
|
||||||
[[ $ipfsnodeid == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
|
[[ "$ipfsnodeid" == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
|
||||||
########################################################################
|
########################################################################
|
||||||
ssbpub=$(sbotc whoami 2>/dev/null | jq -r .id)
|
ssbpub=$(sbotc whoami 2>/dev/null | jq -r .id)
|
||||||
[[ $ssbpub == "" ]] && echo "ERROR sbotc NOT running !! Please check it..." && exit 1
|
[[ "$ssbpub" == "" ]] && echo "ERROR sbotc NOT running !! Please check it..." && exit 1
|
||||||
########################################################################
|
########################################################################
|
||||||
[[ ! -f ~/.ssb/secret.dunikey ]] && $MY_PATH/tools/secret2dunikey.sh
|
[[ ! -f ~/.ssb/secret.dunikey ]] && $MY_PATH/tools/secret2dunikey.sh
|
||||||
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||||
[[ $g1pub == "" ]] && echo "ERROR g1pub empty !! Please check it..." && exit 1
|
[[ "$g1pub" == "" ]] && echo "ERROR g1pub empty !! Please check it..." && exit 1
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
# GET NODE disk performance. TODO, publish and use as IPFS repartition
|
# GET NODE disk performance. TODO, publish and use as IPFS repartition
|
||||||
|
@ -117,10 +133,17 @@ $imagefile
|
||||||
$id : $type : $size bits
|
$id : $type : $size bits
|
||||||
|
|
||||||
"
|
"
|
||||||
nodename=$(cat /etc/hostname)
|
if [[ -z $nodename ]]; then
|
||||||
extension=$(echo $nodename | cut -d '.' -f 2)
|
nodename=$(cat /etc/hostname)
|
||||||
if [[ $extension == $nodename ]]; then
|
extension=$(echo $nodename | cut -d '.' -f 2)
|
||||||
nodename=$nodename.home
|
if [[ "$extension" == "$nodename" ]]; then
|
||||||
|
PING=$(ping -c1 $nodename.local | fgrep from)
|
||||||
|
if [[ "$PING" != "" ]]; then
|
||||||
|
nodename=$nodename.local
|
||||||
|
else
|
||||||
|
nodename=$nodename.home
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -132,7 +155,7 @@ DUNITERNODE=$($MY_PATH/tools/duniter_getnode.sh)
|
||||||
silkajQuantitativeAmountPattern='Total\sQuantitative\s+=\s+(.*)\s+Ğ1'
|
silkajQuantitativeAmountPattern='Total\sQuantitative\s+=\s+(.*)\s+Ğ1'
|
||||||
if [[ $g1balance =~ $silkajQuantitativeAmountPattern ]]
|
if [[ $g1balance =~ $silkajQuantitativeAmountPattern ]]
|
||||||
then
|
then
|
||||||
myJune="${BASH_REMATCH[1]}"
|
myJune="${BASH_REMATCH[1]}"
|
||||||
else
|
else
|
||||||
myJune="0 June"
|
myJune="0 June"
|
||||||
fi
|
fi
|
||||||
|
@ -140,7 +163,10 @@ fi
|
||||||
# OLD ssb-server publish
|
# OLD ssb-server publish
|
||||||
# sbot publish --type about --about $ssbpub --description "[Astroport Node](https://astroport.com) [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid) - Wallet $g1pub - $diskperf" --name "$title" --image "$id"
|
# sbot publish --type about --about $ssbpub --description "[Astroport Node](https://astroport.com) [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid) - Wallet $g1pub - $diskperf" --name "$title" --image "$id"
|
||||||
# NEW sbotc publish to oasis
|
# NEW sbotc publish to oasis
|
||||||
sbotc publish "{\"type\":\"about\",\"about\":\"$ssbpub\",\"description\":\"![QRCode]($qrid)\\n[Astroport #Swarm0 DEV Station](https://astroport.com)\\n - [Gchange](http://$nodename/gchange/#/app/wot/$g1pub) \\n - [Cesium - $myJune -](https://$nodename/cesium/#/app/wot/$g1pub/) \\n IPFS NODE ID : [$ipfsnodeid](http://localhost:8080/ipns/$ipfsnodeid) \\n DISK: $sizeAvail = $diskperf \\n - [LOVE Land entrance](http://$nodename/) \\n\",\"name\":\"$title\",\"image\":\"$id\"}"
|
[[ "$localname" == "" ]] && localname="localhost"
|
||||||
|
[[ "$localport" != "" ]] && localport=":$localport"
|
||||||
|
[[ "$scheme" == "" ]] && scheme="https"
|
||||||
|
sbotc publish "{\"type\":\"about\",\"about\":\"$ssbpub\",\"description\":\"![QRCode]($qrid)\\n[Astroport #Swarm0 DEV Station](https://astroport.com)\\n - [Gchange]($scheme://$nodename/gchange/#/app/wot/$g1pub) \\n - [Cesium - $myJune -]($scheme://$nodename/cesium/#/app/wot/$g1pub/) \\n IPFS NODE ID : [$ipfsnodeid](http://$localname$localport/ipns/$ipfsnodeid) \\n DISK: $sizeAvail = $diskperf \\n - [LOVE Land entrance]($scheme://$nodename/) \\n\",\"name\":\"$title\",\"image\":\"$id\"}"
|
||||||
|
|
||||||
|
|
||||||
# SSB PUBLISH G1 wallet silkaj balance
|
# SSB PUBLISH G1 wallet silkaj balance
|
||||||
|
|
Loading…
Reference in New Issue