joininbox/scripts/start.script.sh

70 lines
1.2 KiB
Bash
Raw Normal View History

2020-06-13 19:25:26 +01:00
#!/bin/bash
2020-06-22 20:53:48 +01:00
source /home/joinmarket/menu.functions.sh
2020-06-13 19:25:26 +01:00
script="$1"
if [ ${#script} -eq 0 ]; then
2020-06-15 15:34:43 +01:00
echo "must specify a script to run"
2020-06-16 13:12:56 +01:00
exit 1
2020-06-13 19:25:26 +01:00
fi
2020-06-16 14:29:39 +01:00
wallet="$2"
2020-06-16 13:12:56 +01:00
if [ ${#wallet} -eq 0 ] || [ ${wallet} == "" ]; then
2020-06-22 15:15:28 +01:00
echo "must specify a wallet to use"
exit 1
2020-06-15 15:34:43 +01:00
fi
option="$3"
2020-06-21 11:33:57 +01:00
if [ ${#option} -eq 0 ] || [ ${option} = "nooption" ]; then
2020-06-13 19:25:26 +01:00
option=""
fi
2020-06-15 15:34:43 +01:00
mixdepth="$4"
if [ ${#mixdepth} -eq 0 ]; then
mixdepth=""
else
mixdepth="-m$4"
fi
2020-06-13 19:25:26 +01:00
2020-06-15 15:34:43 +01:00
makercount="$5"
2020-06-21 11:33:57 +01:00
if [ ${#makercount} -eq 0 ] || [ ${makercount} = "nomakercount" ]; then
2020-06-15 15:34:43 +01:00
makercount=""
else
makercount="-N$5"
fi
2020-06-13 19:25:26 +01:00
2020-06-15 15:34:43 +01:00
amount="$6"
if [ ${#amount} -eq 0 ]; then
amount=""
fi
address="$7"
if [ ${#address} -eq 0 ]; then
address=""
fi
nickname="$8"
if [ ${#nickname} -eq 0 ]; then
nickname=""
else
nickname="-T $8"
fi
2020-06-17 14:52:34 +01:00
source /home/joinmarket/joinin.conf
2020-06-21 00:42:29 +01:00
if [ ${RPCoverTor} = "on" ]; then
2020-06-15 15:34:43 +01:00
tor="torify"
else
tor=""
fi
2020-06-13 19:25:26 +01:00
2020-06-22 20:53:48 +01:00
clear
# display
echo "Running the command:
2020-06-22 14:37:32 +01:00
$tor python $script.py \
$makercount $mixdepth $(echo $wallet | sed "s#$walletPath##g") $option \
$amount $address $nickname
2020-06-22 20:53:48 +01:00
"
# run
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
$tor python ~/joinmarket-clientserver/scripts/$script.py \
$makercount $mixdepth $wallet $option $amount $address $nickname