Last active
January 6, 2024 10:31
-
-
Save jeremy4971/4a1ffcee281aee1921362822cf8e086c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### | |
# | |
# Original author : Steve Wood | |
# Created : 2010-01-19 | |
# Last Modified : 2022-09-11 | |
# Version : 1.0 | |
# | |
### | |
days=$(uptime | awk '{ print $4 }' | sed 's/,//g') | |
num=$(uptime | awk '{ print $3 }') | |
if [ "$days" = "days" ]; then | |
echo "<result>$num</result>" | |
elif [ "$days" = "day" ]; then | |
echo "<result>1</result>" | |
else | |
echo "<result>0</result>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment