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
#15
My idea is to find the users that can log in and then, to use the list to choose the save location.
Finally copy the file to the save location.
Something like this:

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
    zenity --text-info --width=800 --height=700 --ok-label="Save" --cancel-label="Close" < /tmp/systeminfo-"${DATE}".txt
        if [ $? -ne 0 ]; then
            exit
        else
            #get normal users
            # User id MIN and MAX:          grep "^UID_MIN" /etc/login.defs; grep "^UID_MAX" /etc/login.defs
            # Print users and groups:        awk -F':' '$3>=1000 && $3<=60000 {print $1" "$3}' /etc/passwd
            LL_USER=(`awk -F':' '$3>=1000 && $3<=60000 {print "/home/"$1"/Desktop"}' /etc/passwd`)
           
            save_location=$(zenity --list --text="Select the save location" --column="1" "${LL_USER[@]}")
                if [ $? -ne 0 ]; then
                    exit
                else
                        cp /tmp/systeminfo-"${DATE}".txt $save_location
                        # chown
                fi
           
        fi

else
   exit
fi

exit
Reply


Messages In This Thread
Create System Report GUI - by misko_2083 - 11-30-2014, 07:01 PM
Re: Create System Report GUI - by mlsmith - 11-30-2014, 07:23 PM
Re: Create System Report GUI - by misko_2083 - 11-30-2014, 07:40 PM
Re: Create System Report GUI - by mlsmith - 11-30-2014, 08:40 PM
Re: Create System Report GUI - by mlsmith - 11-30-2014, 08:58 PM
Re: Create System Report GUI - by misko_2083 - 11-30-2014, 11:24 PM
Re: Create System Report GUI - by mlsmith - 11-30-2014, 11:52 PM
Re: Create System Report GUI - by Valtam - 12-01-2014, 12:51 AM
Re: Create System Report GUI - by Valtam - 12-01-2014, 01:35 AM
Re: Create System Report GUI - by mlsmith - 12-01-2014, 01:45 AM
Re: Create System Report GUI - by Valtam - 12-01-2014, 01:51 AM
Re: Create System Report GUI - by mlsmith - 12-01-2014, 02:03 AM
Re: Create System Report GUI - by Valtam - 12-01-2014, 02:05 AM
Re: Create System Report GUI - by sysdrum - 12-01-2014, 12:29 PM
Re: Create System Report GUI - by misko_2083 - 12-01-2014, 03:55 PM
Re: Create System Report GUI - by sysdrum - 12-01-2014, 04:00 PM
Re: Create System Report GUI - by misko_2083 - 12-01-2014, 04:19 PM
Re: Create System Report GUI - by sysdrum - 12-01-2014, 04:25 PM
Re: Create System Report GUI - by sysdrum - 12-01-2014, 04:39 PM
Re: Create System Report GUI - by misko_2083 - 12-01-2014, 07:17 PM
Re: Create System Report GUI - by sysdrum - 12-01-2014, 08:21 PM
Re: Create System Report GUI - by Valtam - 12-01-2014, 08:29 PM
Re: Create System Report GUI - by mlsmith - 12-02-2014, 12:10 PM
Re: Create System Report GUI - by sysdrum - 12-02-2014, 02:43 PM
Re: Create System Report GUI - by misko_2083 - 12-02-2014, 04:21 PM
Re: Create System Report GUI - by mlsmith - 12-02-2014, 11:36 PM
Re: Create System Report GUI - by misko_2083 - 12-03-2014, 01:12 AM
Re: Create System Report GUI - by mlsmith - 12-03-2014, 01:54 AM
Re: Create System Report GUI - by sysdrum - 12-03-2014, 02:48 AM
Re: Create System Report GUI - by Valtam - 12-06-2014, 09:42 AM

Forum Jump:


Users browsing this thread: 10 Guest(s)