Page 1 of 1

Porteus Diag Tool

Posted: 23 Apr 2011, 14:29
by Hamza
This is a tool for report your current configuration on the forum.

All credits go to brokenman!

Code: Select all

#!/bin/bash

ver=`cat /etc/porteus-version`
user=$(whoami)
osdrive=$(ls /mnt/live/mnt)
kernel=$(uname -r)
machine=$(uname -m)
mounted=$(df -Th | grep dev)
processor=$(uname -p)
cfg=$(cat /proc/cmdline)
ram=$(fgrep Mem /proc/meminfo)
sound=$(cat /proc/asound/cards)
network=$(ifconfig)
ns=$(cat /etc/resolv.conf)
usb=$(lsusb)
pci=$(lspci)
modules=$(ls -1 /mnt/live/memory/images)
dmes=$(dmesg | tail )
logs=$(cat /var/log/messages | tail)
soundriver=$(cat /proc/asound/version)
screen=$(xrandr | grep Screen)


get_config() {
echo '=== Version of Porteus ==' >> $config
echo $ver >> $config
echo '=== Current User ===' >> $config
echo $user >> $config
echo '=== Screen info ===' >> $config
echo $screen >> $config
echo '=== Boot Device ===' >> $config
echo $osdrive >> $config
echo '=== Kernel Info ===' >> $config
echo $kernel >> $config
echo '=== Machine Info ===' >> $config
echo $machine >> $config
echo '=== Devices Mounted ===' >> $config
echo $mounted >> $config
echo '=== CPU Info ===' >> $config
echo $processor >> $config
echo '=== Boot Config ===' >> $config
echo $cfg >> $config
echo '=== RAM Info ===' >> $config
echo $ram >> $config
echo '=== Sound Info ===' >> $config
echo $sound >> $config
echo '   ' >> $config
echo 'Sound Driver' >> $config
echo $sounddriver >> $config
echo '=== Network Info ===' >> $config
echo $network >> $config
echo '=== DNS Local ===' >> $config
echo $ns >> $config >> $config
echo '=== USB Devices ===' >> $config
echo $usb >> $config >> $config
echo '=== PCI Devices ===' >> $config
echo $pci >> $config
echo '=== Modules Info ===' >> $config
echo $modules >> $config
echo '==== SysLog ====' >> $config
echo 'DMesg file :' >> $config
echo '   ' >> $config
echo $dmes >> $config
echo '   ' >> $config
echo 'Messages file' >> $config
echo $logs >> $config
}

if [ "$1" = "-info" ]; then
echo " "
echo "USAGE : Run $0 without any arguments"
echo "Written for Porteus OS"
echo " "
echo "Porteus Diag Tool"
echo "Version 0.1alpha"
echo "All credits go to Brokenman" 
exit
else
echo " "
echo "USAGE : Run $0 without any arguments"
echo "Written for Porteus OS"
echo " "
exit
fi

if [ "$1" = "-version" ]; then
echo " "
echo "Porteus Diag Tool"
echo "Version 0.1alpha"
echo "Written for The Porteus Community"
echo "All credits is for Brokenman" 
exit
fi

echo "Where do you want to save the output of this script?"
echo "You must type the full path."
read config

if [ -d $config ]; then 
clear
echo "I cannot save your config file in $config"
echo "Exiting..."
else
echo "Good ,You have selected an empty for save your config file."
get_config
fi
Any suggestions are welcome!

Re: Porteus Diag Tool

Posted: 23 Apr 2011, 18:46
by Quax
board=$(dmidecode | grep -A2 "Base Board")

Quax

Re: Porteus Diag Tool

Posted: 23 Apr 2011, 18:47
by 82issa
Need to add md5sums on xzm's so they can be identified corrupt or out dated.

Re: Porteus Diag Tool

Posted: 23 Apr 2011, 18:57
by Hamza
board=$(dmidecode | grep -A2 "Base Board")
You can post your version.

Thanks for suggestion !

Posted after 1 minute 36 seconds:
Need to add md5sums on xzm's so they can be identified corrupt or out dated.
Can't add it.

Re: Porteus Diag Tool

Posted: 24 Apr 2011, 22:52
by fanthom
@82issa
"Need to add md5sums on xzm's so they can be identified corrupt or out dated."
have a look on /usr/bin/chkbase.sh script

Re: Porteus Diag Tool

Posted: 02 May 2011, 13:44
by brokenman
psinfo (Porteus system info) is already included in Porteus. Hamza if you can use the psinfo script to make something better please do so. Keep it as CLI though and the result should be a text file on the users desktop.

Re: Porteus Diag Tool

Posted: 02 May 2011, 14:12
by Hamza
I can include the Dialog Box , but must know what are the only desktops included in Porteus.

Will add a function for looks if it's KDE/LXDE Desktop.

Thanks Brokenman!

Re: Porteus Diag Tool

Posted: 02 May 2011, 23:01
by brokenman
I can include the Dialog Box
Probably better if it doesn't have a dialog box. One reason someone might be using the script is because of a problem getting into an X session, or botting porteus. In this case they won't have the opportunity to see a dialog box. This is why i left psinfo as CLI.