mirror of
https://github.com/openoms/joininbox.git
synced 2026-08-17 13:07:15 +02:00
Update _commands.sh
This commit is contained in:
parent
f25f6a0b2e
commit
b3af7daa67
1 changed files with 30 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue