Prioritize /opt/pangolin as default directory across backup, inspection, and remote testing

This commit is contained in:
jschantli committed 2026-09-04 21:10:40 -07:00
1 parent 2527045bc6
commit a4eb7a2fa9
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -134,13 +134,21 @@ async def test_vps_connection(settings: Optional[Dict[str, Any]] = None) -> Dict
docker_version = stdout_docker.strip() if docker_installed else "Not detected"
# 3. Check Pangolin Directory
pangolin_dir = settings.get("vps_pangolin_dir", "/opt/pangolin")
chk_dir_cmd = f'[ -d "{pangolin_dir}" ] && echo "DIR_EXISTS" || echo "DIR_MISSING"'
pangolin_dir = settings.get("vps_pangolin_dir", "/opt/pangolin").strip() or "/opt/pangolin"
chk_dir_cmd = f"""
eval P_DIR="{pangolin_dir}"
P_DIR="${{P_DIR/#~/$HOME}}"
[ -d "$P_DIR" ] && echo "DIR_EXISTS" || echo "DIR_MISSING"
"""
_, stdout_dir, _ = await run_remote_quick(chk_dir_cmd, settings)
pangolin_dir_found = "DIR_EXISTS" in stdout_dir
# 4. Check SQLite database status in Pangolin directory
chk_db_cmd = f'find "{pangolin_dir}" -name "*.db" -o -name "*.sqlite" 2>/dev/null'
chk_db_cmd = f"""
eval P_DIR="{pangolin_dir}"
P_DIR="${{P_DIR/#~/$HOME}}"
find "$P_DIR" -name "*.db" -o -name "*.sqlite" 2>/dev/null
"""
_, stdout_db, _ = await run_remote_quick(chk_db_cmd, settings)
dbs_found = [p.strip() for p in stdout_db.strip().split("\n") if p.strip()]