mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2026-08-06 16:08:22 +00:00
Simplify and align MOTD status
This commit is contained in:
parent
bbbf80c25f
commit
254a9b9cf3
1 changed files with 2 additions and 5 deletions
|
|
@ -162,7 +162,7 @@ pivilion_service_state() {
|
|||
pivilion_print_motd() {
|
||||
local heading=${1:-Welcome to Pivilion!}
|
||||
local show_addresses=${2:-yes}
|
||||
local uptime_text memory_free memory_total load_one load_five load_fifteen processes torname desired active backend health addresses
|
||||
local uptime_text memory_free memory_total load_one load_five load_fifteen processes torname desired active addresses
|
||||
|
||||
uptime_text=$(uptime -p 2>/dev/null || printf 'unknown')
|
||||
memory_free=$(awk '/^MemAvailable:/ {print $2; exit}' /proc/meminfo 2>/dev/null)
|
||||
|
|
@ -176,8 +176,6 @@ pivilion_print_motd() {
|
|||
[ ! -s "$PIVILION_DIR/torname" ] || torname=$(tr -d '\r\n' < "$PIVILION_DIR/torname")
|
||||
desired=$(pivilion_current_mode)
|
||||
active=$(pivilion_state_value active_mode not-verified)
|
||||
backend=$(pivilion_state_value backend unknown)
|
||||
health=$(pivilion_state_value health unknown)
|
||||
addresses=$(pivilion_state_value addresses none)
|
||||
|
||||
printf '\n%s\n' "$heading"
|
||||
|
|
@ -190,8 +188,7 @@ pivilion_print_motd() {
|
|||
@ @ . #@@@# . @ @ Running Processes..: $processes
|
||||
@ @@@, # ,@@@ @ Manual / more info.: pivilion.net
|
||||
@@, @ ,@@ Onion Address......: $torname
|
||||
@@@@@#@@@@@@@#@@@@@ Desired / active....: $desired / $active
|
||||
Backend / health...: $backend / $health
|
||||
@@@@@#@@@@@@@#@@@@@ Desired / active...: $desired / $active
|
||||
EOF
|
||||
if [ "$show_addresses" = yes ]; then
|
||||
printf ' IP addresses.......: %s\n' "$addresses"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue