blob: 705c655ef79113ee81fbacb8412113a756782094 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
uptime_output=""
if [ "$(uname)" == "Darwin" ]; then
uptime_output=$(uptime| cut -d',' -f3| cut -d':' -f2)
else
uptime_output=$(uptime| cut -d',' -f4,5,6|cut -d':' -f2)
fi
uptime_output=${uptime_output#" "}
echo "$uptime_output"
exit 0
|