2016-11-25 19:02:28 +01:00
|
|
|
#!/bin/bash
|
2026-06-29 09:42:14 +02:00
|
|
|
set -euo pipefail
|
|
|
|
|
source /usr/local/lib/pivilion/common.sh
|
|
|
|
|
pivilion_load_config
|
2016-11-25 21:34:26 +01:00
|
|
|
|
2026-06-29 21:43:47 +02:00
|
|
|
case "${1:-status}" in
|
|
|
|
|
status) [ "$#" -le 1 ] || { echo "Usage: pivilion [status|diagnose [--json]]" >&2; exit 2; } ;;
|
|
|
|
|
diagnose) shift; exec /usr/local/lib/pivilion/diagnose.sh "$@" ;;
|
|
|
|
|
*) echo "Usage: pivilion [status|diagnose [--json]]" >&2; exit 2 ;;
|
|
|
|
|
esac
|
|
|
|
|
|
2026-06-29 17:29:00 +02:00
|
|
|
pivilion_print_motd
|
2022-06-18 22:42:53 +00:00
|
|
|
|
2026-06-29 21:43:47 +02:00
|
|
|
failure=$(pivilion_state_value failure none)
|
|
|
|
|
|
2026-06-29 09:42:14 +02:00
|
|
|
cat <<EOF
|
2016-11-25 19:02:28 +01:00
|
|
|
|
2026-06-29 17:29:00 +02:00
|
|
|
Web root: $PIVILION_WEBROOT
|
2026-06-29 21:43:47 +02:00
|
|
|
Apache: $(pivilion_service_state apache2)
|
|
|
|
|
Tor: $(if systemctl cat tor@default.service >/dev/null 2>&1; then pivilion_service_state tor@default.service; else pivilion_service_state tor.service; fi)
|
|
|
|
|
Last activation failure: $failure
|
2016-11-25 19:02:28 +01:00
|
|
|
|
2026-06-29 09:42:14 +02:00
|
|
|
Commands:
|
|
|
|
|
pivilion show this status
|
|
|
|
|
onion select Tor onion mode for the next reboot
|
|
|
|
|
hotspot select open captive-hotspot mode for the next reboot
|
|
|
|
|
pikey save upstream Wi-Fi credentials for onion mode
|
|
|
|
|
generator enable or disable the gallery generator on port 81
|
|
|
|
|
static convert the current gallery to static files
|
|
|
|
|
hotglue install or restore Hotglue
|
|
|
|
|
htaccess reset or remove captive redirect rules
|
2026-06-29 21:43:47 +02:00
|
|
|
pivilion diagnose [--json] check networking, redirects, and services
|
|
|
|
|
pivilion-diagnose compatibility alias for diagnostics
|
2026-06-29 09:42:14 +02:00
|
|
|
EOF
|