From 59297a8eb7e5efebdb5b9ce0d577b357ddebea0c Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:13:37 +0330 Subject: [PATCH] Import source: fix_and_start.sh Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- fix_and_start.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 fix_and_start.sh diff --git a/fix_and_start.sh b/fix_and_start.sh new file mode 100644 index 0000000..b4e5200 --- /dev/null +++ b/fix_and_start.sh @@ -0,0 +1,57 @@ + +#!/bin/bash + +pkill -9 -f "main.py" 2>/dev/null + +pkill -9 -f "rub.py" 2>/dev/null + +sleep 2 + + + +# Force unlock via Python + +python3 -c " + +import sqlite3, os + +db = 'tel2rub.session' + +if os.path.exists(db): + + conn = sqlite3.connect(db, timeout=1) + + conn.execute('PRAGMA journal_mode=DELETE') + + conn.commit() + + conn.close() + +" 2>/dev/null + + + +# Break the lock by moving the file to a new inode + +if [ -f "tel2rub.session" ]; then + + cp tel2rub.session tel2rub.session.fixed + + rm -f tel2rub.session + + mv tel2rub.session.fixed tel2rub.session + +fi + + + +rm -f tel2rub.session-journal tel2rub.session-wal tel2rub.session-shm + + + +nohup /root/fuck-irgc/Tele2Rub/venv/bin/python3 -u main.py > out.log 2>&1 & + +sleep 3 + +tail -f out.log +