ERASE ALL FOR NEW INSTALL
This commit is contained in:
parent
ae69de2dfe
commit
e0e56d17df
|
@ -7,6 +7,8 @@
|
|||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
|
||||
[[ ! $($which bc) ]] && sudo apt-get install bc -y
|
||||
|
||||
function log () {
|
||||
[[ "$DOLOG" == "YES" ]] && echo "$PHONE:$1" >> /tmp/g1sms.log;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|||
NODE_G1PUBKEY=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
[[ $NODE_G1PUBKEY == "" ]] && echo "ERROR NODE_G1PUBKEY empty !! Please check it..." && exit 1
|
||||
|
||||
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
|
||||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||
NANODATE=$(date -u +%s%N) #1569692075385428020
|
||||
|
||||
|
@ -38,13 +38,16 @@ if [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]]; then
|
|||
# And write ~/.zen/g1sms_wallets/.Qm***/G1SSB/(_files)
|
||||
####################################################################
|
||||
PRE=${MASTERPHONE:8:4}
|
||||
ZUID=$(./diceware.sh 1 | xargs)
|
||||
ZUID=$($MY_PATH/diceware.sh 1 | xargs)
|
||||
# Check if already existing among all swarm wallets G1SSB or G1SMS
|
||||
while [[ $(grep -Rwl "$PRE$ZUID" ~/.zen/ipfs_swarm/.*/*/_uidna) ]]; do ZUID=$(./diceware.sh 1 | xargs); done
|
||||
while [[ $(grep -Rwl "$PRE$ZUID" ~/.zen/ipfs_swarm/.*/*/_uidna) ]]; do ZUID=$($MY_PATH/diceware.sh 1 | xargs); done
|
||||
NODE_UIDNA="$PRE$ZUID"
|
||||
NODE_PIN=$(./diceware.sh | xargs)
|
||||
NODE_PIN=$($MY_PATH/diceware.sh | xargs)
|
||||
|
||||
[[ -f ~/.zen/secret.astroport.key ]] && echo "NODE_UIDNA=$NODE_UIDNA" >> ~/.zen/secret.astroport.key
|
||||
[[ -f ~/.zen/secret.astroport.key ]] \
|
||||
&& [[ ! $(cat ~/.zen/secret.astroport.key | grep -F 'NODE_UIDNA' )]] \
|
||||
&& echo "NODE_UIDNA=$NODE_UIDNA" >> ~/.zen/secret.astroport.key
|
||||
|
||||
source ~/.zen/secret.astroport.key
|
||||
|
||||
# WRITE NODE_UIDNA
|
||||
|
@ -55,8 +58,8 @@ if [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]]; then
|
|||
############ If sudo without password activated (Raspbian)
|
||||
# SYSTEM MODIFY hosts & hostname ###########################
|
||||
# WRITE NODE uidna NAME TO /etc/hosts & .Qm*/_uidna file
|
||||
[[ $USER == "pi" ]] && sudo echo "127.0.0.101 $NODE_UIDNA" >> /etc/hosts
|
||||
[[ $USER == "pi" ]] && sudo echo "$NODE_UIDNA" > /etc/hostname
|
||||
# sudo echo "127.0.0.101 $NODE_UIDNA" >> /etc/hosts
|
||||
# sudo echo "$NODE_UIDNA" > /etc/hostname
|
||||
############################################################
|
||||
|
||||
# TODO rewrite AUTO BACKUP / RESTORE
|
||||
|
@ -72,7 +75,7 @@ if [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]]; then
|
|||
|
||||
fi
|
||||
|
||||
source ~/.zen/secret.astroport.key
|
||||
[[ -f ~/.zen/secret.astroport.key ]] && source ~/.zen/secret.astroport.key || echo "Missing ~/.zen/secret.astroport.key" && exit 1
|
||||
|
||||
NODE_UIDNA=$(cat "~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna")
|
||||
## INIT NODE G1 PUB & PRIV KEY
|
||||
|
|
|
@ -14,10 +14,7 @@ source $MY_PATH/functions.sh
|
|||
STOP="RUN"
|
||||
|
||||
$MY_PATH/search TODO
|
||||
echo "WAAAAHHH ENCORE UNE BELLE LISTE DE TODO ;)"
|
||||
echo "La partie du code sms_ est plutot fonctionnelle."
|
||||
echo "Dé-commentez 'gammu-smsd-inject' dans ./shell/fonction.sh pour tester sans envoyer de SMS!"
|
||||
echo
|
||||
|
||||
echo "Lancez dans une console tail -f /tmp/g1sms.log pour suivre le déroulement (log)"
|
||||
echo
|
||||
echo "On commence la simulation de reception d'un SMS"
|
||||
|
|
|
@ -59,7 +59,8 @@ sbotc publish '{"type":"ipfstryme","text":"'"$(ipfs id | jq -r .Addresses[] | ta
|
|||
# ADD Cesium+ informations
|
||||
CESIUM="https://g1.data.le-sou.org"
|
||||
|
||||
title=$(curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.title')
|
||||
[[ -f ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_uidna ]] && uidna=$(cat ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_uidna)
|
||||
[[ ! $uidna ]] && title=$(curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.title') || title="Station $uidna"
|
||||
[[ $title == null ]] && title="Station $USER@$(cat /etc/hostname)"
|
||||
city=$(curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.city')
|
||||
[[ $city != null ]] && title="$title in $city"
|
||||
|
@ -79,6 +80,7 @@ qrencode -s 5 -o ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png "$g1pub"
|
|||
|
||||
if [[ ! $(file "/tmp/avatar.png" | grep 'PNG') ]]; then
|
||||
qrcodefile=~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png
|
||||
rm -f /tmp/avatar.png
|
||||
else
|
||||
qrcodefile=/tmp/avatar.png
|
||||
fi
|
||||
|
|
|
@ -87,7 +87,7 @@ export PATH=$PATH:~/.local/bin
|
|||
if [[ ! $(which silkaj) ]]; then
|
||||
sudo apt update || true
|
||||
libzzz=$(sudo apt-cache search libsodium | awk '{print $1}' | grep libsodium2)
|
||||
sudo apt install build-essential qrencode jq $libzzz -y
|
||||
sudo apt install libffi-dev build-essential qrencode jq bc $libzzz -y
|
||||
sudo apt install python3-pip python3-setuptools python3-wheel -y
|
||||
sudo pip3 install base58
|
||||
pip3 install silkaj --user
|
||||
|
@ -326,6 +326,10 @@ Manual activation #Swarm0 Astroport Station:
|
|||
~/.zen/astroport/zen/cron_VRFY.sh
|
||||
~/.zen/astroport/zen/ssb_INIT.sh
|
||||
|
||||
!!!!!! ERASE ALL FOR NEW INSTALL !!!!!!
|
||||
rm -Rf ~/.ssb*
|
||||
rm -f .zen/secret.astroport.key
|
||||
|
||||
Submit issues: https://git.p2p.legal/axiom-team/astroport/issues
|
||||
Send ideas to support@qo-op.com
|
||||
"
|
||||
|
|
Loading…
Reference in New Issue