Merge branch 'master' of https://github.com/dylanaraps/neofetch
This commit is contained in:
commit
0f80628b4c
6
neofetch
6
neofetch
|
@ -1216,8 +1216,14 @@ get_uptime() {
|
||||||
# Get uptime in seconds.
|
# Get uptime in seconds.
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "Windows" | "MINIX")
|
"Linux" | "Windows" | "MINIX")
|
||||||
|
if [[ -r /proc/uptime ]]; then
|
||||||
seconds="$(< /proc/uptime)"
|
seconds="$(< /proc/uptime)"
|
||||||
seconds="${seconds/.*}"
|
seconds="${seconds/.*}"
|
||||||
|
else
|
||||||
|
boot="$(date -d"$(uptime -s)" +%s)"
|
||||||
|
now="$(date +%s)"
|
||||||
|
seconds="$((now - boot))"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT")
|
"Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT")
|
||||||
|
|
Reference in New Issue