mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2026-08-07 00:18:23 +00:00
34 lines
1.2 KiB
Bash
Executable file
34 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
source /usr/local/lib/pivilion/common.sh
|
|
pivilion_load_config
|
|
|
|
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
|
|
|
|
pivilion_print_motd
|
|
|
|
failure=$(pivilion_state_value failure none)
|
|
|
|
cat <<EOF
|
|
|
|
Web root: $PIVILION_WEBROOT
|
|
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
|
|
|
|
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
|
|
pivilion diagnose [--json] check networking, redirects, and services
|
|
pivilion-diagnose compatibility alias for diagnostics
|
|
EOF
|