From fc3501382c2aa3ef5b692f4f55c2616f9cade3f5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Apr 2025 12:18:00 +0200 Subject: Move toolbox scripts to a "bin" directory. Add a super "rtt" command to run the scripts. --- bin/rtt-tm-unban-tick | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 bin/rtt-tm-unban-tick (limited to 'bin/rtt-tm-unban-tick') diff --git a/bin/rtt-tm-unban-tick b/bin/rtt-tm-unban-tick new file mode 100755 index 0000000..7294e81 --- /dev/null +++ b/bin/rtt-tm-unban-tick @@ -0,0 +1,32 @@ +#!/bin/bash + +# Run this script in a cron job to lift tournament bans periodically. + +sqlite3 db < timeout_total) and (julianday() > julianday(timeout_last)+14) as lift_ban + from + user_profile_view + where + user_id in (select user_id from tm_banned) + order by lift_ban desc, timeout_last asc +; + +select * from tm_lift_ban_view; + +delete from tm_banned where user_id in (select user_id from tm_lift_ban_view where lift_ban) returning user_id; + +commit; + +EOF -- cgit v1.2.3