How naposky/slack-plexautoupdate works
Project type and purpose
• This is a small, CLI‐based automation tool (shell + Python) to automatically fetch, build, upgrade, and restart Plex Media Server on a Slackware system. It is neither a full‐stack web app nor a microservice; rather, it’s a scheduled automation utility that ties together:
• Cron for scheduling
• Shell and Python scripts for control flow
• SlackBuild packaging for building .deb → Slackware package
• Slackware’s upgradepkg for installation
• Optional Pushbullet for notifications
File structure
• Top-level files:
• autoCatch.sh — main shell driver, intended to be cron’d
• autoUpgrade.py — core logic for fetching latest version, enforcing retention policy
• plexmediaserver.SlackBuild — SlackBuild script for building the package
• rc.plexmediaserver — init/script to start & stop the Plex service
• doinst.sh — (standard SlackBuild “do install” script fragment)
• README.md — project overview & instructions
• plexmediaserver.SlackBuild, doinst.sh, rc.plexmediaserver follow Slackware packaging conventions
Key behaviors from README
• autoCatch.sh performs:
a) Call autoUpgrade.py
b) Download .deb from Plex repository (with optional PlexPass token)
c) Invoke plexmediaserver.SlackBuild to convert .deb → Slackware package
d) Call upgradepkg to install
e) Restart Plex via rc.plexmediaserver
f) Optionally send a Pushbullet notification
g) Prune old versions, keep N (default 5)
Components to put
a. Cron scheduler (external trigger)
b. autoCatch.sh (Shell orchestrator)
c. autoUpgrade.py (Python logic module)
d. Plex repository API (external service)
e. Local file system / working directory (holding downloaded .deb, built packages, version directories)
f. SlackBuild tooling (plexmediaserver.SlackBuild + doinst.sh)
g. Slackware package manager (upgradepkg)
h. init script (rc.plexmediaserver)
i. Optional Pushbullet API (external notification service)
Relationships & data flow
1. Cron → triggers autoCatch.sh
2. autoCatch.sh → invokes autoUpgrade.py
3. autoUpgrade.py → HTTP GET to Plex repo API → receives .deb
4. autoUpgrade.py → writes .deb to local FS
5. autoCatch.sh → calls plexmediaserver.SlackBuild → builds Slackware package
6. autoCatch.sh → calls upgradepkg → installs new Plex package
7. autoCatch.sh → calls rc.plexmediaserver restart → Plex service cycles
8. autoCatch.sh → optionally calls sendNotification → Pushbullet API
9. autoUpgrade.py → also performs cleanup on local FS (prune old builds)
Architectural patterns & design principles
• Modular separation: Shell script for orchestration, Python script for version logic
• Single-responsibility: SlackBuild script solely handles packaging, rc script solely handles service management
• External integration points: HTTP APIs (Plex repo, Pushbullet), OS package manager
• Idempotency & scheduling: Designed to run unattended via cron
• Retention policy implemented in code rather than external system
Final advice
• Be very detailed: include every script and its role
• Optional paths (e.g., Pushbullet branch)
• Boundaries: external vs. host
• Don’t overcomplicate: this is a linear, cron‐based automation