Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve yg nickname detection; show nick on info screen #37

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ function YGuptime() {
JMUptime=$(printf '%dd:%dh:%dm\n' $((JMUptimeInSeconds/86400)) $((JMUptimeInSeconds%86400/3600)) $((JMUptimeInSeconds%3600/60)))
}

function YGnickname() {
# Retrieves nickname from the latest NickServ message in the newest logfile
newest_log=$(ls -td /home/joinmarket/.joinmarket/logs/* | grep J5 | head -n 1)
name=$(grep NickServ $newest_log | tail -1 | awk '{print $9}')
echo $name
}

# installJoinMarket [update|testPR <PRnumber>|commit]
function installJoinMarket() {
cpu=$(uname -m)
Expand Down
4 changes: 3 additions & 1 deletion scripts/info.stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ source /home/joinmarket/_functions.sh
feereport
YGuptime

name=$(YGnickname)

echo "JoinMarket stats:day:week:month
coinjoins as a Maker:$dayCoinjoins:$weekCoinjoins:$monthCoinjoins
sats earned:$dayEarned:$weekEarned:$monthEarned
Maker uptime:$JMUptime" | column -t -s:
Maker ($name) uptime:$JMUptime" | column -t -s:
2 changes: 1 addition & 1 deletion scripts/menu.yg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ case $CHOICE in
/home/joinmarket/menu.yg.sh
;;
NICKNAME)
name=$(ls -t /home/joinmarket/.joinmarket/logs | grep J5 | head -n 1 | cut -c -16)
name=$(YGnickname)
whiptail \
--title "Counterparty name" \
--msgbox "The last used counterparty name for the Order Book:\n
Expand Down