feat: add homelab deployment configs, documentation, and automation scripts
This commit is contained in:
22
scripts/check_gotify_idx.py
Normal file
22
scripts/check_gotify_idx.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import paramiko
|
||||
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect('140.44.4.71', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
py_script = """import sqlite3
|
||||
conn = sqlite3.connect('/mnt/swarm_shared/legacy_volumes/gotify/gotify.db')
|
||||
cur = conn.cursor()
|
||||
indexes = cur.execute("SELECT name, sql FROM sqlite_master WHERE type='index' AND tbl_name='applications'").fetchall()
|
||||
for idx in indexes:
|
||||
print(idx)
|
||||
"""
|
||||
|
||||
stdin, stdout, stderr = c.exec_command("cat > /tmp/check_idx.py && python3 /tmp/check_idx.py")
|
||||
stdin.write(py_script)
|
||||
stdin.close()
|
||||
print(stdout.read().decode())
|
||||
print(stderr.read().decode())
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user