Porteus Diag Tool
Posted: 23 Apr 2011, 14:29
This is a tool for report your current configuration on the forum.
All credits go to brokenman!
Any suggestions are welcome!
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