From b3af7daa67a75d4769df4e7ae3ac3a4ea6acf0d5 Mon Sep 17 00:00:00 2001 From: nyxnor <69700936+nyxnor@users.noreply.github.com> Date: Sun, 13 Jun 2021 23:56:23 +0000 Subject: [PATCH] Update _commands.sh --- scripts/_commands.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/_commands.sh b/scripts/_commands.sh index ce8fcf3..7b5a2eb 100755 --- a/scripts/_commands.sh +++ b/scripts/_commands.sh @@ -11,16 +11,46 @@ function menu() { /home/joinmarket/menu.sh } +# command: newnym +function newnym(){ + if [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "runBehindTor=on")" -eq 1 ]; then + echo "Changing Tor circuits..." + echo "Savind old ID..." + oldID=$(curl --connect-timeout 15 --socks5-hostname 127.0.0.1:9050 ifconfig.me 2>/dev/null) + echo "Requesting new identity ..." + sudo python3 /home/joininbox/scripts/standalone/tor.newnym.py + sleep 3 + echo "Savind new ID..." + newID=$(curl --connect-timeout 15 --socks5-hostname 127.0.0.1:9050 ifconfig.me 2>/dev/null) + echo + if [ ${oldID} = ${newID} ]; then + echo "!!! FAIL: Identity did not change. Read error message above." + echo "Exiting for precaution" + exit 0 + else + echo "!!! SUCCESS" + echo "Old id: " ${oldID} + echo "New id: " ${newID} + fi + else + echo "Not running behind Tor" + fi +} + # command: torthistx function torthistx() { if [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "runBehindTor=on")" -eq 1 ]&&\ [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "network=signet")" -eq 1 ]; then echo + newnym + echo echo "Broadcasts a transaction through Tor to mempool.space's API and into the network..." echo echo "Transaction ID:" curl --socks5-hostname localhost:9050 -d "$1" -X POST https://mempool.space/signet/api/tx elif [ "$(cat /home/joinmarket/joinin.conf 2>/dev/null | grep -c "runBehindTor=on")" -eq 1 ]; then + echo + newnym echo echo "Broadcasts a transaction through Tor to Blockstream's API and into the network..." echo