mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
bash readability of iiab-diagnostics
This commit is contained in:
parent
e70511971a
commit
49f44b37e0
1 changed files with 56 additions and 54 deletions
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# create a diagnostic collection, and documet OS settings
|
# Create a diagnostic collection, and document OS settings.
|
||||||
|
# PLEASE SEE iiab-diagnostics.README.md
|
||||||
|
|
||||||
read -p "\n\nPlease provide a name or nickname: (8 characters or less, no spaces) " who
|
read -p "\n\nPlease provide a name or nickname: (8 characters or less, no spaces) " who
|
||||||
if [ -z "$who" ]; then
|
if [ -z "$who" ]; then
|
||||||
who="noname"
|
who="noname"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build up a meaningful name for transmission back to the development team
|
# Build up a meaningful name for transmission to dev team(s)
|
||||||
OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2`
|
OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2`
|
||||||
pushd /opt/iiab/iiab
|
pushd /opt/iiab/iiab
|
||||||
HASH=`git log --pretty=format:'g%h' -n 1`
|
HASH=`git log --pretty=format:'g%h' -n 1`
|
||||||
|
@ -18,10 +19,10 @@ diagnostics_name=${OS_VER}-$YMD-$who
|
||||||
outfile=$diagnostics_name.$$
|
outfile=$diagnostics_name.$$
|
||||||
VARS_VALUES=/tmp/all-vars
|
VARS_VALUES=/tmp/all-vars
|
||||||
|
|
||||||
# record all the ansible variables
|
# Record all Ansible variables
|
||||||
pushd /opt/iiab/iiab > /dev/null
|
# pushd /opt/iiab/iiab > /dev/null
|
||||||
# ./runrole all-vars $VARS_VALUES
|
# ./runrole all-vars $VARS_VALUES
|
||||||
popd > /dev/null
|
# popd > /dev/null
|
||||||
|
|
||||||
# cat files in this direcory
|
# cat files in this direcory
|
||||||
function cat_dir() {
|
function cat_dir() {
|
||||||
|
@ -67,6 +68,7 @@ function cat_file_list(){
|
||||||
cat_file $f
|
cat_file $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# collect all the network info in one place
|
# collect all the network info in one place
|
||||||
cat << EOF > /tmp/diagnostics_script
|
cat << EOF > /tmp/diagnostics_script
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
@ -93,7 +95,7 @@ if [ -f /etc/rpi-issue ];then
|
||||||
cat /etc/rpi-issue
|
cat /etc/rpi-issue
|
||||||
echo "stage2 = lite; stage5 = desktop SEE https://github.com/RPi-Distro/pi-gen#stage-anatomy"
|
echo "stage2 = lite; stage5 = desktop SEE https://github.com/RPi-Distro/pi-gen#stage-anatomy"
|
||||||
else
|
else
|
||||||
echo "not a raspberry pi"
|
echo "Not a Raspberry Pi."
|
||||||
fi
|
fi
|
||||||
echo "=IIAB====================================================="
|
echo "=IIAB====================================================="
|
||||||
echo "/sbin/brctl show"
|
echo "/sbin/brctl show"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue