Import source: fix_and_start.sh
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
Reference in New Issue
Block a user