-
Notifications
You must be signed in to change notification settings - Fork 3
/
runPiCollectEnv
executable file
·78 lines (63 loc) · 2.25 KB
/
runPiCollectEnv
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Copyright 2019 Hernán Morales Durand. All Rights Reserved.
#
set -u # Check for undefined variables
# set -o noclobber # Avoid overlay files (echo "hi" > foo)
# set -o errexit # Used to exit upon error, avoiding cascading errors
# set -o pipefail # Unveils hidden failures
set -o nounset # Exposes unset variables
source libexec/piUtils.sh
printf "Collecting system information...\n"
output_file=pi_env.txt
rm -f "$output_file"
{
printf '\n'
printf '== are we in docker =============================================\n'
num=$(cat /proc/1/cgroup | grep docker | wc -l);
if [ $num -ge 1 ]; then
echo "Yes"
else
echo "No"
fi
printf '\n'
printf '== uname =====================================================\n'
uname -a 2>&1
printf '\n'
printf '== bash =====================================================\n'
bash --version 2>&1
printf '\n'
printf '== git =====================================================\n'
cmd_exists git && git --version 2>&1
printf '\n'
printf '== wget =====================================================\n'
cmd_exists wget && wget --version 2>&1
printf '\n'
printf '== curl =====================================================\n'
cmd_exists curl && curl --version 2>&1
printf '\n'
printf '== openssl =====================================================\n'
cmd_exists openssl && openssl version 2>&1
printf '\n'
printf '== jq =====================================================\n'
cmd_exists jq && jq --version 2>&1
printf '\n'
printf '== bats =====================================================\n'
cmd_exists bats && bats --version 2>&1
printf '\n'
printf '== env ==========================================================\n'
if [ -z ${LD_LIBRARY_PATH+x} ]; then
printf "LD_LIBRARY_PATH is unset\n";
else
printf LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ;
fi
if [ -z ${DYLD_LIBRARY_PATH+x} ]; then
printf "DYLD_LIBRARY_PATH is unset\n";
else
printf DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH} ;
fi
} >> ${output_file}
printf "Wrote environment to ${output_file}. You can review the contents of that file.\n"
printf "and use it to populate the fields in the github issue template.\n"
printf '\n'
printf "cat ${output_file}\n"
printf '\n'