| Server IP : 157.230.181.24 / Your IP : 216.73.217.11 Web Server : Apache/2.4.58 (Ubuntu) System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /proc/thread-self/root/opt/aim-bots/ |
Upload File : |
#!/usr/bin/env python3
"""Extract, deploy, and buddy-list a batch of side-chick bots from the manifest."""
from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
MANIFEST = Path("/opt/aim-bots/side_chicks_manifest.json")
PERSONAS = Path("/opt/aim-bots/personas")
def screenname_for_key(key: str, candidates: list[dict]) -> str:
for c in candidates:
if c.get("key") == key:
return c.get("screenname", key)
return key
def main() -> int:
only_new = "--new" in sys.argv
manifest = json.loads(MANIFEST.read_text())
keys = manifest["deployed_bots"]
candidates = manifest.get("candidates", [])
if only_new:
keys = [k for k in keys if not (PERSONAS / k / "persona.json").exists()]
if not keys:
print("nothing new to extract")
return 0
extracted = []
for key in keys:
sn = screenname_for_key(key, candidates)
print(f"extracting {sn}...")
subprocess.run(
[sys.executable, "/opt/aim-bots/extract_side_persona.py", sn],
check=True,
)
extracted.append(key)
if extracted:
subprocess.run([sys.executable, "/opt/aim-bots/create_side_chick_services.py"], check=True)
for key in extracted:
d = PERSONAS / key
(d / "memories").mkdir(exist_ok=True)
subprocess.run(["chown", "-R", "ras:ras", str(d)], check=True)
subprocess.run(
[sys.executable, "/opt/aim-bots/add_conan_buddies.py", *extracted],
check=True,
)
subprocess.run([sys.executable, "/opt/aim-bots/set_aim_profiles.py"], check=True)
subprocess.run(["systemctl", "daemon-reload"], check=True)
for key in extracted:
subprocess.run(["systemctl", "enable", f"aim-bot-{key}.service"], check=False)
subprocess.run(["systemctl", "restart", f"aim-bot-{key}.service"], check=True)
print(f"deployed {len(extracted)} bots: {', '.join(extracted)}")
elif not only_new:
print("nothing to deploy")
return 0
if __name__ == "__main__":
raise SystemExit(main())