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 +