Skip to content

Commit

Permalink
added uptime from /proc/uptime. closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitehead0 committed Jun 18, 2024
1 parent 5b99cb7 commit f59b084
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/runner_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Get OS name
OS_NAME=$(grep "PRETTY_NAME=" /etc/os-release | cut -d'"' -f2)

# https://unix.stackexchange.com/a/34033 - get uptime from /proc/uptime in human readable format
UPTIME=$(awk '{printf("%d:%02d:%02d:%02d\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}' /proc/uptime)

# Get OS Version
if [[ $OS_NAME == *"Amazon"* ]]; then
Expand All @@ -27,6 +28,7 @@ fi

echo "OS: ${OS_NAME}"
echo "OS Version: ${OS_VERSION}"
echo "Uptime: ${UPTIME}"

# if runner service is running then we can determine installation path and get additional info
if pgrep "runsvc.sh" >/dev/null; then
Expand Down

0 comments on commit f59b084

Please sign in to comment.