-
Notifications
You must be signed in to change notification settings - Fork 0
/
what_platform_is_this.sh
30 lines (18 loc) · 1021 Bytes
/
what_platform_is_this.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Script Author: Jeremy Donson, NYC; jjdonson@gmail.com
# Script Purpose: Detect platform including os version and flavor, and resources, as well as test for git and python3 versions.
# Execution Pattern: $ bash what_platform__is_this.sh
# Potential Risks: NONE, as this is a read-only script.
echo -en 'This bash script is designed to query this system platform,\nincluding os version and flavor, and resources,\nas well as test for git and python3 versions.\n\n'
echo -en 'To continue script execution, type y and press RETURN:\n'
read YN
if [ "$YN" == 'y' ] || [ "$YN" == 'Y' ] || [ "$YN" == 'yes' ] || [ "$YN" == 'Yes' ] || [ "$YN" == 'YES' ]
then echo -en 'Script executing.... Querying system.'
else { echo -en 'Script quitting due to lack of user confirmation.'; exit;}
fi
# If the follow error out, then we are likely on windows....
HOST_SYSTEM=$(uname -a)
BASH_VERSION=$(bash --version)
GIT_VERSION=$(git version)
PY3_VERSION=$(python3 --version)
FACTER_VERSION=$(facter --version)