LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create System Report GUI
#1
This is what I've done so far.
Added: A question to start the process
            Progress bar to display messages as the report continues
            A question to display the results
Problem is next:
            $HOME environment variable prints out /root when the script is run with 'gksudo'
If we have a script
Code:
#!/bin/bash
# This script is /usr/scripts/some_script
echo $HOME
and run it with gksudo we'll get
Code:
$ gksudo /usr/scripts/some_script
/root

So it's saving the report in the '/root' directory

Solution:
              Running the script with 'gksudo -k /usr/scripts/systeminfo'
From man gksu
--preserve-env, -k

              Preserve the current environments, does not set $HOME nor $PATH,
              for example.


Here is the full script:
Code:
#!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems
# Dependencies - lshw, dmidecode, hdparm
# Developer - Jerry Bezencon
# Creation Date - Monday 29th April, 2013
# Website - http://www.freecinema2022.gq
# Credits - Various people at the Linux Distro Community including but not limited to:
# Armageddon, pdq, pingcasts, preecher, setkeh, Shaggytwodope, Stripe, zoose


DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf $HOME/systeminfo*

# Script start
if zenity --title="Question" --question text="Click Yes to proceed, No to cancel";  then

# Create file and insert date
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> $HOME/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
# Begin reporting information

(
echo "1"
echo "#This Report may take a while to generate..."
sleep 2


echo "5"
echo "#Collecting Bios & Motherboard Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " BIOS:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> $HOME/systeminfo-"${DATE}".txt

echo " MOTHERBOARD:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "10"
echo "#CPU Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "CPU Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lscpu >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "17"
echo "#Collecting Memory Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Memory Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " RAM SPEED:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "25"
echo "#Collecting Graphics Chip Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo lshw -C display >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "40"
echo "#Collecting Sound Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Sound Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
aplay --list-devices >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "45"
echo "#Collecting Hard Drive/SSD Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
df -T >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " MOUNT:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
mount >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " FDISK:" >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " HDPARM:" >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> $HOME/systeminfo-"${DATE}".txt

echo "50"
echo "#Collecting Groups Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Groups Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
groups $USER >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "55"
echo "#Collecting PCI Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "PCI Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lspci >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "60"
echo "#Collecting USB Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "USB Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsusb >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "65"
echo "#Collecting Kernel Modules Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsmod >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "70"
echo "#Collecting Kernel & OS Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
uname -a >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsb_release -d >> $HOME/systeminfo-"${DATE}".txt
lsb_release -i >> $HOME/systeminfo-"${DATE}".txt
lsb_release -c >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
echo "Based on:" >> $HOME/systeminfo-"${DATE}".txt
cat /etc/issue.net >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "75"
echo "#Collecting Network Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Network Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
ifconfig >> $HOME/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo lshw -C network >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "80"
echo "#Collecting Environment Variables"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
printenv >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "85"
echo "#Collecting Software Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
dpkg --list >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt


echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "End of Report" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "#Done"
echo "100"

) | zenity --progress --auto-close --title="system report" --no-cancel

else
   exit
fi

# Prompt user to open report
if zenity --title="Question" --question text="Would you like to open the report now?" ; then
xdg-open $HOME/systeminfo-"${DATE}".txt
else
   exit 1
fi
exit
Reply
#2
Thanks misko. Have you considered using YAD for the gui?
Reply
#3
Yo're welcome Smile
I personally like YAD, but there is no way of telling when the development of YAD will end.
If that happens, and we have GUI tools that depend on it, then we would have a big problem.
Zenity is more likely to stay, so we are staying with it.
Cheers Smile
Reply
#4
Good to know! Thanks. Will you be putting these in some kind of VCS so that we can submit patches? Smile
Reply
#5
Also some notes about the script:

* It would be nice if it saved the text file in the same location as the script itself
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
* Typo in the dialog title: says "sytem" instead of "system"
* It did not produce BIOS and Motherboard info for me
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
Reply
#6
(11-30-2014, 08:58 PM)mlsmith link Wrote: Also some notes about the script:

* It would be nice if it saved the text file in the same location as the script itself
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
* Typo in the dialog title: says "sytem" instead of "system"
* It did not produce BIOS and Motherboard info for me
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
* It would be nice if it saved the text file in the same location as the script itself
The script is ment to be the part of OS in /usr/scripts
You don't want to have your report in that location. Smile
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
Strange, xdg-open should open it in a text editor.
* Typo in the dialog title: says "sytem" instead of "system"
Thank you. Fixed.
* It did not produce BIOS and Motherboard info for me
Did you start the script in a terminal?
gksudo -k /path/to/the/script
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
That's how the script works. The same thing is with the current one. Find it in the Whisker menu. It's named 'Create System Report'.
Reply
#7
Ah, ok - that makes sense. Some of those issues could be related to me not running them as superuser.
Reply
#8
This is awesome! Any chance we can get the text file to pop up in a zenity text info box at the end?
Reply
#9
Some cosmetic changes, code changes, report now save to /tmp etc...

Code:
#!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems
# Dependencies - lshw, dmidecode, hdparm
# Developer - Misko_2083, Jerry Bezencon
# Creation Date - 30th November, 2013
# Website - http://www.freecinema2022.gq

DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf /tmp/systeminfo*

# Script start
if zenity --question --title="Create System Report" --text="Click Yes to proceed or No to cancel";  then

# Create file and insert date
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
# Begin reporting information

(
echo "1"
echo "#This Report may take a while to generate..."
sleep 2


echo "5"
echo "#Collecting Bios & Motherboard Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " BIOS:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> /tmp/systeminfo-"${DATE}".txt

echo " MOTHERBOARD:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "10"
echo "#CPU Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "CPU Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lscpu >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "17"
echo "#Collecting Memory Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Memory Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " RAM SPEED:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "25"
echo "#Collecting Graphics Chip Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C display >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "40"
echo "#Collecting Sound Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Sound Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
aplay --list-devices >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "45"
echo "#Collecting Hard Drive/SSD Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
df -T >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " MOUNT:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
mount >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " FDISK:" >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo " HDPARM:" >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> /tmp/systeminfo-"${DATE}".txt

echo "50"
echo "#Collecting Groups Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Groups Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
groups $USER >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "55"
echo "#Collecting PCI Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "PCI Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lspci >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "60"
echo "#Collecting USB Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "USB Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsusb >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "65"
echo "#Collecting Kernel Modules Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsmod >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "70"
echo "#Collecting Kernel & OS Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
uname -a >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsb_release -d >> /tmp/systeminfo-"${DATE}".txt
lsb_release -i >> /tmp/systeminfo-"${DATE}".txt
lsb_release -c >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "Based on:" >> /tmp/systeminfo-"${DATE}".txt
cat /etc/issue.net >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "75"
echo "#Collecting Network Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Network Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
ifconfig >> /tmp/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C network >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "80"
echo "#Collecting Environment Variables..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
printenv >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "85"
echo "#Collecting Software Information..."
sleep 1

echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
dpkg --list >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt


echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "End of Report" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt

echo "#Done"
echo "100"

) | zenity --progress --auto-close --title="Collecting System Information..." --no-cancel

else
   exit
fi

# Prompt user to open report
if zenity --question --title="Create System Report" --text="Click View Report or Quit" --ok-label="View Report" --cancel-label="Quit" ; then
xdg-open /tmp/systeminfo-"${DATE}".txt
else
   exit 1
fi
exit
Reply
#10
Nice! I like that, Jerry. Should these changes be tracked in Github or is this sort of the testing place before putting it there?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)