Skip to content

Commit d9cf3a6

Browse files
authored
Use os-release for host info
resolves github/ghes#7336
1 parent dfca0ab commit d9cf3a6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/ghe-backup

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,11 @@ fi
231231

232232
# Output system information of the backup host
233233

234-
# If /etc/issue.net exists, use it to get the OS version
235-
if [ -f /etc/issue.net ]; then
236-
echo "Running on: $(cat /etc/issue.net)"
234+
# If /etc/os-release exists, use it to get the OS version
235+
if [ -f /etc/os-release ]; then
236+
OS_NAME=$(grep '^NAME' /etc/os-release | cut -d'"' -f2)
237+
VERSION_ID=$(grep '^VERSION_ID' /etc/os-release | cut -d'"' -f2)
238+
echo "Running on: $OS_NAME $VERSION_ID"
237239
else
238240
echo "Running on: Unknown OS"
239241
fi

0 commit comments

Comments
 (0)