Files
Linux_post_install/bin/pos-entertainment-status
Your Name 99085adc76 feat: add web dashboard with slide-in drawer navigation
- Flask backend with 23 API routes (entertainment, telegram, docker, system)
- Alpine.js + Tailwind CSS dark-mode SPA with 4 tabs
- pos-dashboard CLI tool with port/config management
- Mobile slide-in drawer with swipe-to-close
- Sticky header stays pinned on scroll
- Tab completion fixes for category-less tools
- POST /api/telegram/commands endpoint for adding commands
2026-08-18 11:54:41 -04:00

68 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# POS: entertainment status — Show enabled plugins and scheduler state
source "$(dirname "$0")/../lib/common.sh" 2>/dev/null || source "$(dirname "$0")/common.sh"
source "$(dirname "$0")/../lib/entertainment-lib.sh" 2>/dev/null || source "$(dirname "$0")/entertainment-lib.sh"
usage() {
cat <<EOF
Usage: pos entertainment status
Show the enabled plugins (from ENABLED in $CONFIG_FILE),
the detected scheduler, and the schedule for each plugin.
Enable plugins with: pos entertainment enable <plugin> [interval]
EOF
exit 0
}
case "${1:-}" in
-h|--help) usage ;;
esac
echo
echo "pos entertainment status"
echo "------------------------------------"
echo "Config: $CONFIG_FILE"
raw="$(config_value ENABLED)"
parse_enabled "$raw"
echo "Enabled plugins:"
if [ ${#ENABLED_ENTRIES[@]} -eq 0 ]; then
echo " (none — enable one with: pos entertainment enable <plugin> [interval])"
else
printf ' %b%-12s %-16s %s%b\n' "${BOLD}" "PLUGIN" "INTERVAL" "LAST RUN" "${RESET}"
for entry in "${ENABLED_ENTRIES[@]}"; do
plugin="${entry%%,*}"; interval="${entry##*,}"
[ "$interval" = "$plugin" ] && interval="$DEFAULT_INTERVAL"
printf ' %-12s %-16s %s\n' "$plugin" "$(ut_interval_label "$interval")" "$(last_run_str "$plugin")"
done
fi
not_enabled=()
for name in $(list_plugins "$(ent_plugin_dir)"); do
found=0
for entry in "${ENABLED_ENTRIES[@]}"; do
[ "${entry%%,*}" = "$name" ] && found=1 && break
done
[ "$found" -eq 0 ] && not_enabled+=("$name")
done
if [ ${#not_enabled[@]} -gt 0 ]; then
echo
echo "Installed but not enabled:"
for name in "${not_enabled[@]}"; do
printf ' %s\n' "$name"
done
fi
echo
if systemctl --user show-environment >/dev/null 2>&1; then
echo "Scheduler: systemd user timers"
echo "Timers (systemd --user):"
systemctl --user list-timers --no-pager 'pos-entertainment-*.timer' 2>/dev/null || \
echo " (no timers)"
else
echo "Scheduler: none available (no systemd user manager)"
fi