Skip to content

Commit

Permalink
Update _commands.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nyxnor committed Jun 13, 2021
1 parent f25f6a0 commit b3af7da
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/_commands.sh
Expand Up @@ -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
Expand Down

0 comments on commit b3af7da

Please sign in to comment.