mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 21:33:59 +02:00
Old uncommited changes, restock from cli, "cleanup bounty" feature
This commit is contained in:
parent
84881dece3
commit
934873c2fc
6 changed files with 51 additions and 2 deletions
18
brmbar3/uklid-watchdog.sh
Normal file
18
brmbar3/uklid-watchdog.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
LASTIDF=/home/brmlab/uklid.last
|
||||
|
||||
LASTID=`cat $LASTIDF 2>/dev/null || echo 0`
|
||||
|
||||
|
||||
RES=`psql brmbar -Atq -c "select id,description from transactions where id>$LASTID and description like 'BrmBar sale of 1x uklid%' LIMIT 1;"`
|
||||
if [ ! -z "$RES" ]; then
|
||||
LASTID=`echo "$RES"|cut -d '|' -f 1`
|
||||
echo $LASTID > $LASTIDF
|
||||
|
||||
WINNER=`echo "$RES"|grep -o 'to [^ ]*'|cut -d ' ' -f 2`
|
||||
if [ -z "$WINNER" ]; then
|
||||
WINNER="anonymous hunter"
|
||||
fi
|
||||
echo "Brmlab cleanup bounty was claimed by $WINNER! Thanks!"|ssh jenda@fry.hrach.eu
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue