16 lines
372 B
Bash
Executable File
16 lines
372 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ -r /var/status/status ]; then
|
|
cat /var/status/status
|
|
else
|
|
echo "server status unavailable"
|
|
fi
|
|
|
|
[ -n "$SESSION_ID" ] && echo "session ${SESSION_ID}"
|
|
|
|
if [ -n "$SESSION_EXPIRES_AT" ]; then
|
|
remaining=$((SESSION_EXPIRES_AT - $(date +%s)))
|
|
[ "$remaining" -lt 0 ] && remaining=0
|
|
printf 'expires in %d:%02d\n' $((remaining / 60)) $((remaining % 60))
|
|
fi
|