#!/bin/bash
# Pup-SysInfo 2.6 (functions)
# Copyright 2015 GPL3
# Roger Grider (radky)

export TEXTDOMAIN=func
export OUTPUT_CHARSET=UTF-8

WORKDIR="/usr/local/Pup-SysInfo"

#define current window manager
if [ -f "$HOME/Choices/windowmanager" ]; then
  CURRWM=`cat "$HOME/Choices/windowmanager"` #TazOC LHP
else
  CURRWM=`cat /etc/windowmanager`
fi
. /etc/DISTRO_SPECS
if [ "$DISTRO_NAME" = "Fatdog64" ]; then
 if [ -s "$FATDOG_STATE_DIR/windowmanager" ]; then
  CURRWM=`cat "$FATDOG_STATE_DIR/windowmanager"`
 elif [ "`pidof openbox`" ]; then
  CURRWM="openbox-session"
 elif [ "`pidof jwm`" ]; then
  CURRWM="jwm"
 elif [ "`pidof icewm`" ]; then
  CURRWM="icewm"
 elif [ "`pidof xfwm4`" ]; then
  CURRWM="xfwm4"
 fi
 echo "$CURRWM" > /etc/windowmanager
fi

#check support of version-sort
if [ "`sort --help | grep 'version-sort'`" ]; then
 VER="-V"
else
 VER=""
fi

case "$1" in

-partview)
	if [ "`which fatdog-disk-usage.sh`" ]; then
	 fatdog-disk-usage.sh &
	elif [ "`which partview`" ]; then
	 partview &
	else Xdialog --title Alert --beep --msgbox " $(gettext 'Partview is not available.') " 0 0 &
	fi
	;;

-pupscan) if [ "`which pupscan`" ]; then pupscan & else Xdialog --title Alert --beep --msgbox " $(gettext 'PupScan is not available.') " 0 0 & fi ;;

-pup_sysinfo)
	if [ ! "`pidof Pup-SysInfo`" ]; then
	 echo "$(gettext 'Please select a menu item...')" > /tmp/pup-sysinfo.txt
	 $WORKDIR/Pup-SysInfo &
	else Xdialog --title Alert --beep --msgbox " $(gettext 'Pup-SysInfo is already active.') " 0 0 &
	fi
	;;

-sysinfo) if [ "`which hardinfo`" ]; then hardinfo & else Xdialog --title Alert --beep --msgbox " $(gettext 'Hardinfo is not available.') " 0 0 & fi ;;

-sysinfo_activity)
	. /etc/DISTRO_SPECS
	. $WORKDIR/func -sysinfo_storage
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	echo -e "$(gettext 'Pup-SysInfo System Report (Summary),') `date +'%a %-e %b %Y'`" > /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_uptime
	echo -e "\n▶—— $(gettext 'BASE STATUS') ——◀\n" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Linux Kernel:') `uname -r` (`uname -m`)" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Version:') `uname -v`" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_kernelpae
	echo -e "\n$(gettext 'Username:') "`whoami`"" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_country
	. $WORKDIR/func -sysinfo_distro
	. $WORKDIR/func -sysinfo_netsummary
	echo >> /tmp/pup-sysinfo.txt
	cat /tmp/sysinfo-network 2>/dev/null >> /tmp/pup-sysinfo.txt
	SAVESIZE=`df -h | grep dev_save | awk '{print $2}'`
	SAVEFREE=`df -h | grep dev_save | awk '{print $4}'`
	[ "$SAVESIZE" ] && SAVESIZEFREE="($(gettext 'Size') $SAVESIZE, $(gettext 'Free') $SAVEFREE)"
	[ "$PUPMODE" = "12" -o "$PUPMODE" = "13" ] && SAVEPARTSPACE="$SAVESIZEFREE"
	echo >> /tmp/pup-sysinfo.txt
	[ "$SAVESIZE" ] && echo -e "$(gettext 'Boot Partition:') $BOOTPART $SAVEPARTSPACE" >> /tmp/pup-sysinfo.txt
	[ "$DEV1FS" ] && echo -e "$(gettext 'Boot File System:') $BOOTFS" >> /tmp/pup-sysinfo.txt
	[ "$PMEDIA" ] && echo -e "$(gettext 'Boot Media:') $BOOTMEDIA" >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	grep -E '^PUPMODE|^PUPSFS|^PUPSAVE' /etc/rc.d/PUPSTATE | sed s/\'//g >> /tmp/pup-sysinfo.txt
	[ "`grep SAVEFILE_PATH /etc/BOOTSTATE 2>/dev/null`" ] && echo -e "`grep SAVEFILE_PATH /etc/BOOTSTATE`" >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'COMMAND-LINE HISTORY') (/root/.history) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`cat /root/.history 2>/dev/null`" ]; then
	 cat /root/.history | tail -n 100 >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No command history is detected in /root/.history.')" >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'ENVIRONMENT VARIABLES') (env) ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_variables
	echo -e "\n▶—— $(gettext 'INSTALLED PACKAGES') (/var/log/packages) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`ls /var/log/packages 2>/dev/null`" ]; then
	 ls /var/log/packages | sort -fu >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No packages are detected.')" >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'INSTALLED PETS') (/root/.packages/user-installed-packages) ——◀\n" >> /tmp/pup-sysinfo.txt
	cut -d "|" -f 1,10 /root/.packages/user-installed-packages > /tmp/installedpkgs.results
	if [ "`cat /tmp/installedpkgs.results 2>/dev/null`" ]; then
	 cat /tmp/installedpkgs.results | sort -fu >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No user-installed PET packages are detected.')" >> /tmp/pup-sysinfo.txt
	fi
	if [ "`cat /root/.packages/alienpackages.txt 2>/dev/null`" ]; then
	 echo -e "\n▶—— $(gettext 'INSTALLED PETS') (/root/.packages/alienpackages.txt) ——◀\n" >> /tmp/pup-sysinfo.txt
	 cat /root/.packages/alienpackages.txt | cut -d " " -f1 | sed 's/\"//g' | sort -fu >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'INSTALLED SFS FILES') (losetup) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`losetup | grep -Ev 'loop[0-3]'`" ]; then
	 losetup | grep -Ev 'loop[0-3]' | awk -F'/' '{print $NF}' | sort >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No installed (add-on) SFS files are detected.')" >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'LOADED KERNEL MODULES') (lsmod) ——◀\n" >> /tmp/pup-sysinfo.txt
	lsmod | grep -v Module | awk '{print $1}' | sort >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'KMODULE BLACKLIST') (/etc/modprobe.d/blacklist.conf) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`cat /etc/modprobe.d/blacklist.conf 2>/dev/null`" ]; then
	 cat /etc/modprobe.d/blacklist.conf | awk -F' ' '{print $NF}' | sort >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No kernel modules detected in /etc/modprobe.d/blacklist.conf')" >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'STARTUP FILES') ($HOME/.config/autostart/) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`ls $HOME/.config/autostart | grep .desktop 2>/dev/null`" ]; then
	 ls $HOME/.config/autostart | grep .desktop | grep -v desktop.bak | sort -fu | sed -e 's/.desktop//' -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No files are detected in') $HOME/.config/autostart." >> /tmp/pup-sysinfo.txt	
	fi
	echo -e "\n▶—— $(gettext 'STARTUP FILES') ($HOME/Startup/) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`find -L $HOME/Startup -perm -111 -type f -maxdepth 1 2>/dev/null`" ]; then
	 find -L $HOME/Startup -perm -111 -type f -maxdepth 1 | awk -F'/' '{print $NF}' | sort -fu | sed -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No files are detected in') $HOME/Startup." >> /tmp/pup-sysinfo.txt	
	fi
	echo -e "\n▶—— $(gettext 'STARTUP FILES') (/etc/init.d/) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`find -L /etc/init.d -perm -111 -type f -maxdepth 1 2>/dev/null`" ]; then
	 find -L /etc/init.d -perm -111 -type f -maxdepth 1 | awk -F'/' '{print $NF}' | sort -fu | sed -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No files are detected in /etc/init.d.')" >> /tmp/pup-sysinfo.txt	
	fi
	echo -e "\n▶—— $(gettext 'SYSTEM PROCESSES') ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`which top`" ];then
	 top -b -n1 | sed -e '/^Load average/G' -e '$d' >> /tmp/pup-sysinfo.txt
	else
	 ps auxww | cut -c1-37,45-51,65- | grep -vwE 'cut|sysinfo_activity' >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n\n*********************************************" >> /tmp/pup-sysinfo.txt
	echo -e "***************** $(gettext 'LOG FILES') *****************" >> /tmp/pup-sysinfo.txt
	echo -e "*********************************************\n" >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'BOOT INIT LOG') (/initrd/tmp/bootinit.log) ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_bootinit
	echo -e "\n▶—— $(gettext 'BOOT SYSINIT LOG') (/tmp/bootsysinit.log) ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_bootsysinit
	echo -e "\n▶—— $(gettext 'KERNEL BOOT-TIME LOG') (dmesg) ——◀\n" >> /tmp/pup-sysinfo.txt
	dmesg 2>/dev/null | head -n 1500 | sed -e 's/[©®–]//g' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'KERNEL AND SYSTEM-ACTIVITY LOG') (/var/log/messages) ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`cat /var/log/messages 2>/dev/null`" ]; then
	 cat /var/log/messages 2>/dev/null | tail -n 1000 | sed -e '/./,/^$/!d' -e 's/[©®–]//g' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in /var/log/messages.')" >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'X-ERROR LOG') (/tmp/xerrs.log) ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_xerrslog
	echo -e "\n▶—— $(gettext 'XORG LOG') (/var/log/Xorg.0.log) ——◀\n" >> /tmp/pup-sysinfo.txt
	cat /var/log/Xorg.0.log 2>/dev/null | tail -n 2200 | sed '/./,/^$/!d' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'XORG CONFIGURATION') (/etc/X11/xorg.conf) ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_xorg.conf
	echo -e "\n=== $(gettext 'END OF ACTIVITY REPORT') ===\n" >> /tmp/pup-sysinfo.txt
	sed -i -e 's/▶——/====>/g' -e 's/——◀/<====/g' -e 's/▶/=>/g' -e 's/▸/=>/g' -e 's/•/+/g' -e 's/—/-/g' -e 's/–/-/g' /tmp/pup-sysinfo.txt
	SYSDATE="`date +'%y%m%d'`"
	PRIVATE=`cat $PREFDIR/psi_private 2>/dev/null`
	echo -e "$(gettext 'This report is also available in')\n/tmp/${USER}/PSI-SYS-SUMMARY-$SYSDATE." >> /tmp/pup-sysinfo.txt
	[ "$PRIVATE" = "true" ] && grep -Ev 'Hostname:|Monthly Data:|Session Data:|Domain Name Server|External IP Address:|Hardware Address|Network IP Address:|Part Number:|SerialNumber|Serial Number|Username:|UUID:|Wireless Network:|Asset Tag:' /tmp/pup-sysinfo.txt 2>/dev/null > /tmp/tmp && mv -f /tmp/tmp /tmp/pup-sysinfo.txt
	mkdir -p /tmp/${USER}/
	cat /tmp/pup-sysinfo.txt 2>/dev/null > /tmp/${USER}/PSI-SYS-SUMMARY-$SYSDATE
	cat /tmp/pup-sysinfo.txt 2>/dev/null | gzip -f > /tmp/${USER}/PSI-SYS-SUMMARY-$SYSDATE.gz
	kill $XPID
	;;

-sysinfo_audio)
	rm -f /tmp/sysinfo-audio 2>/dev/null
	if [ "`lspci -knn`" ]; then
	 AUDIODEVICES=`lspci -knn | grep -iv Subsystem: | sed -e 's/driver in use/• Kernel Driver/g' -e 's/modules/• Kernel Module/g' | cut -d " " -f2- | sed '/./,/^$/!d' | grep -A1 'Audio'`
	 AUDIODRIVERS=`echo "$AUDIODEVICES" | grep '• Kernel Driver' | awk -F' ' '{print $NF}'`
	 if [ "$AUDIODRIVERS" ]; then
	  for DRIVER in $AUDIODRIVERS
	   do
	     echo "$AUDIODEVICES" | grep -EB1 "$DRIVER" >> /tmp/sysinfo-audio
	     echo "$DRIVER" > /tmp/KMODULE.tmp
	     . $WORKDIR/func -sysinfo_kmodules
	     if [ "`lsmod | grep "$DRIVER"`" ]; then
	      cat /tmp/sysinfo-kernel | grep -E 'Memory Used:|Path:|Description:|^Version:' | tr -s ' ' | sed -e 's/Memory Used/• Memory Used/' -e 's/Path/• Path/' -e 's/Description/• Description/' -e 's/Version/• Driver Version/' >> /tmp/sysinfo-audio
	     fi
	     echo >> /tmp/sysinfo-audio
	   done
	 sed -i '$d' /tmp/sysinfo-audio
	 else
	  lspci -nn | grep -E 'Audio' | sed -r 's/^[^ \t]*[ \t]+//g' > /tmp/sysinfo-audio
	 fi
	else
	 lspci -nn | grep -E 'Audio' | sed -r 's/^[^ \t]*[ \t]+//g' > /tmp/sysinfo-audio
	fi
	if [ ! "`grep 'Audio' /tmp/sysinfo-audio`" ]; then
	 echo "$(gettext 'The lspci command finds no audio information.')" > /tmp/sysinfo-audio
	fi
	;;

-sysinfo_bat0)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X2PID=$!
	BATTERY0=""
	BATTERY0=$(cat $PREFDIR/psi_bat0 2>/dev/null)
	[ ! "$BATTERY0" ] && BATTERY0="BAT0"
	if [ -f /proc/acpi/battery/$BATTERY0/state ]; then
	 if [ ! "`lsmod | grep -q '^battery'`" ]; then
	  modprobe battery 2>/dev/null
	  modprobe ac 2>/dev/null
	 fi
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY0) ——◀\n" > /tmp/sysinfo-battery
	 echo -e "$(gettext 'Complete Report:')" >> /tmp/sysinfo-battery
	 dmidecode -t 22 | grep -E 'Manufacture Date:|Name:' | sed -e 's/Date:/Date:       /g' -e 's/Name:/Name:                   /g' -e 's/^/ /' -e 's/	//g' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/battery/$BATTERY0/info | grep -E 'capacity|voltage' | sed 's/^/ /' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/battery/$BATTERY0/state | sed -e 's/^/ /' -e '/present:/d' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/ac_adapter/AC/state | sed -e 's/^/ /' -e 's/ state:   / AC-state:/g' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 if [ "`which acpitool`" ]; then
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e "`acpitool -B | sed -e 's/^[ \t]*/ /' | sed -e '/Battery #/d' -e 's/:/     /' | grep -i 'capacity'`" >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 else
	  DC=$( grep 'design capacity  ' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  LFC=$( grep 'last full capacity' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  LFCcalc=$( echo "scale=3; $LFC / $DC * 100" | bc )
	  RC=$( grep 'remaining capacity' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  RCcalc=$( echo "scale=3; $RC / $LFC * 100" | bc )
	  CLcalc=$( echo "scale=3; 100 - $LFCcalc" | bc )
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Remaining capacity:')      $RC mAh, $RCcalc%" | sed -e 's/00%/% of last full capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Design capacity:')         $DC mAh" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Last full capacity:')      $LFC mAh, $LFCcalc%" | sed -e 's/00%/% of design capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Capacity loss:')           $CLcalc%" | sed -e 's/00%/%/' >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 fi
	elif [ -f /sys/class/power_supply/$BATTERY0/uevent ]; then
	 if [ ! "`lsmod | grep -q 'battery'`" ]; then
	  modprobe battery 2>/dev/null
	  modprobe ac 2>/dev/null
	 fi
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY0) ——◀\n" > /tmp/sysinfo-battery
	 echo -e "$(gettext 'Specifications:')" >> /tmp/sysinfo-battery
	 dmidecode -t 22 | grep 'Manufacture Date:' | sed -e 's/Manufacture Date: /MANUFACTURE DATE=/g' -e 's/^/ /' -e 's/	//g' >> /tmp/sysinfo-battery
	 cat /sys/class/power_supply/$BATTERY0/uevent | grep -E 'NAME|STATUS|TECHNOLOGY|MODEL_NAME|MANUFACTURER' | sed 's/POWER_SUPPLY_/ /g' >> /tmp/sysinfo-battery
	 cat /sys/class/power_supply/$BATTERY0/uevent | grep -E 'CHARGE|ENERGY' > /tmp/sysinfo-battery2
	 if [ "`which acpitool`" ]; then
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e "`acpitool -B | sed -e 's/^[ \t]*/ /' | sed -e '/Battery #/d' -e 's/:/     /' | grep -i 'capacity'`" >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 else
	  DC=$( grep 'CHARGE_FULL_DESIGN' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$DC" ] && DC=$( grep 'ENERGY_FULL_DESIGN' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  LFC=$( grep 'CHARGE_FULL=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$LFC" ] && LFC=$( grep 'ENERGY_FULL=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  LFCcalc=$( echo "scale=3; $LFC / $DC * 100" | bc )
	  RC=$( grep 'CHARGE_NOW' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$RC" ] && RC=$( grep 'ENERGY_NOW=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  RCcalc=$( echo "scale=3; $RC / $LFC * 100" | bc )
	  CLcalc=$( echo "scale=3; 100 - $LFCcalc" | bc )
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Remaining capacity:')      $RC mAh, $RCcalc%" | sed -e 's/00%/% of last full capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Design capacity:')         $DC mAh" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Last full capacity:')      $LFC mAh, $LFCcalc%" | sed -e 's/00%/% of design capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Capacity loss:')           $CLcalc%" | sed -e 's/00%/%/' >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 fi
	else
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY0) ——◀\n" > /tmp/sysinfo-battery
	 echo "$BATTERY0 $(gettext 'is not detected.')" >> /tmp/sysinfo-battery
	fi
	kill $X2PID
	;;

-sysinfo_bat1)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X2PID=$!
	BATTERY1=""
	BATTERY1=$(cat $PREFDIR/psi_bat1 2>/dev/null)
	[ ! "$BATTERY1" ] && BATTERY1="BAT1"
	if [ -f /proc/acpi/battery/$BATTERY1/state ]; then
	 if [ ! "`lsmod | grep -q '^battery'`" ]; then
	  modprobe battery 2>/dev/null
	  modprobe ac 2>/dev/null
	 fi
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY1) ——◀\n" > /tmp/sysinfo-battery
	 echo -e "$(gettext 'Complete Report:')" >> /tmp/sysinfo-battery
	 dmidecode -t 22 | grep -E 'Manufacture Date:|Name:' | sed -e 's/Date:/Date:       /g' -e 's/Name:/Name:                   /g' -e 's/^/ /' -e 's/	//g' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/battery/$BATTERY1/info | grep -E 'capacity|voltage' | sed 's/^/ /' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/battery/$BATTERY1/state | sed -e 's/^/ /' -e '/present:/d' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 cat /proc/acpi/ac_adapter/AC/state | sed -e 's/^/ /' -e 's/ state:   / AC-state:/g' | sed 's/:/ /g' >> /tmp/sysinfo-battery
	 if [ "`which acpitool`" ]; then
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e "`acpitool -B | sed -e 's/^[ \t]*/ /' | sed -e '/Battery #/d' -e 's/:/     /' | grep -i 'capacity'`" >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 else
	  DC=$( grep 'design capacity  ' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  LFC=$( grep 'last full capacity' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  LFCcalc=$( echo "scale=3; $LFC / $DC * 100" | bc )
	  RC=$( grep 'remaining capacity' /tmp/sysinfo-battery | rev | awk '{print $2}' | rev )
	  RCcalc=$( echo "scale=3; $RC / $LFC * 100" | bc )
	  CLcalc=$( echo "scale=3; 100 - $LFCcalc" | bc )
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Remaining capacity:')      $RC mAh, $RCcalc%" | sed -e 's/00%/% of last full capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Design capacity:')         $DC mAh" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Last full capacity:')      $LFC mAh, $LFCcalc%" | sed -e 's/00%/% of design capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Capacity loss:')           $CLcalc%" | sed -e 's/00%/%/' >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 fi
	elif [ -f /sys/class/power_supply/$BATTERY1/uevent ]; then
	 if [ ! "`lsmod | grep -q 'battery'`" ]; then
	  modprobe battery 2>/dev/null
	  modprobe ac 2>/dev/null
	 fi
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY1) ——◀\n" > /tmp/sysinfo-battery
	 echo -e "$(gettext 'Specifications:')" >> /tmp/sysinfo-battery
	 dmidecode -t 22 | grep 'Manufacture Date:' | sed -e 's/Manufacture Date: /MANUFACTURE DATE=/g' -e 's/^/ /' -e 's/	//g' >> /tmp/sysinfo-battery
	 cat /sys/class/power_supply/$BATTERY1/uevent | grep -E 'NAME|STATUS|TECHNOLOGY|MODEL_NAME|MANUFACTURER' | sed 's/POWER_SUPPLY_/ /g' >> /tmp/sysinfo-battery
	 cat /sys/class/power_supply/$BATTERY1/uevent | grep -E 'CHARGE|ENERGY' > /tmp/sysinfo-battery2
	 if [ "`which acpitool`" ]; then
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e "`acpitool -B | sed -e 's/^[ \t]*/ /' | sed -e '/Battery #/d' -e 's/:/     /' | grep -i 'capacity'`" >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 else
	  DC=$( grep 'CHARGE_FULL_DESIGN' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$DC" ] && DC=$( grep 'ENERGY_FULL_DESIGN' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  LFC=$( grep 'CHARGE_FULL=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$LFC" ] && LFC=$( grep 'ENERGY_FULL=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  LFCcalc=$( echo "scale=3; $LFC / $DC * 100" | bc )
	  RC=$( grep 'CHARGE_NOW' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  [ ! "$RC" ] && RC=$( grep 'ENERGY_NOW=' /tmp/sysinfo-battery2 | cut -d "=" -f2 | sed 's/.\{3\}$//' )
	  RCcalc=$( echo "scale=3; $RC / $LFC * 100" | bc )
	  CLcalc=$( echo "scale=3; 100 - $LFCcalc" | bc )
	  echo -e "\n$(gettext 'Capacity Summary:')" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Remaining capacity:')      $RC mAh, $RCcalc%" | sed -e 's/00%/% of last full capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Design capacity:')         $DC mAh" >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Last full capacity:')      $LFC mAh, $LFCcalc%" | sed -e 's/00%/% of design capacity/' >> /tmp/sysinfo-battery
	  echo -e " $(gettext 'Capacity loss:')           $CLcalc%" | sed -e 's/00%/%/' >> /tmp/sysinfo-battery
	  echo >> /tmp/sysinfo-battery
	 fi
	else
	 echo -e "▶—— $(gettext 'DEVICES: NOTEBOOK BATTERY') ($BATTERY1) ——◀\n" > /tmp/sysinfo-battery
	 echo "$BATTERY1 $(gettext 'is not detected.')" >> /tmp/sysinfo-battery
	fi
	kill $X2PID
	;;

-sysinfo_batID)
	if [ "$sysBAT" -o "$procBAT" ]; then
	 if [ "$(ls /sys/class/power_supply/)" ]; then
	  BATID=$(ls /sys/class/power_supply/ | grep -v AC)
	 elif [ "$(ls /proc/acpi/battery/)" ]; then
	  BATID=$(ls /proc/acpi/battery/ | grep -v AC)
	 fi
	 Xdialog --title "$(gettext 'Battery')" --under-mouse --msgbox "$BATID" 200x125
	else
	 Xdialog --title "$(gettext 'Battery')" --under-mouse --msgbox "$(gettext 'No battery')" 200x125
	fi
	;;

-sysinfo_bootinit)
	if [ "`cat /initrd/tmp/bootinit.log`" ]; then
	 echo -e "$(gettext "'FATAL' messages may be insignificant.")\n" >> /tmp/pup-sysinfo.txt
	 cat /initrd/tmp/bootinit.log | sed -e 's/[©®–]//g' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in') /initrd/tmp/bootinit.log." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_bootsysinit)
	if [ "`cat /tmp/bootsysinit.log`" ]; then
	 cat /tmp/bootsysinit.log | tail -n 2200 | sed -e 's/[©®–]//g' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in') /tmp/bootsysinit.log." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_complete)
	. $WORKDIR/func -sysinfo_hardware
	. $WORKDIR/func -sysinfo_activity
	echo -e "=====================================" > /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Hardware and System Activity Reports:')" >> /tmp/pup-sysinfo.txt
	echo -e "=====================================\n" >> /tmp/pup-sysinfo.txt
	cat /tmp/${USER}/PSI-HW-COMPLETE-$SYSDATE >> /tmp/pup-sysinfo.txt
	echo -e "\n\n*********************************************" >> /tmp/pup-sysinfo.txt
	echo -e "*********************************************" >> /tmp/pup-sysinfo.txt
	echo -e "*********************************************" >> /tmp/pup-sysinfo.txt
	echo -e "*********************************************\n\n" >> /tmp/pup-sysinfo.txt
	cat /tmp/${USER}/PSI-SYS-SUMMARY-$SYSDATE >> /tmp/pup-sysinfo.txt
	echo -e "\n***************\n" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'HARDWARE REPORT:') /tmp/${USER}/PSI-HW-COMPLETE-$SYSDATE" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'SYSTEM ACTIVITY:') /tmp/${USER}/PSI-SYS-SUMMARY-$SYSDATE" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'COMPLETE REPORT:') /tmp/${USER}/PSI-SYS-COMPLETE-$SYSDATE" >> /tmp/pup-sysinfo.txt
	sed -i -e 's/▶——/====>/g' -e 's/——◀/<====/g' -e 's/▶/=>/g' -e 's/▸/=>/g' -e 's/•/+/g' -e 's/—/-/g' -e 's/–/-/g' /tmp/pup-sysinfo.txt
	cat /tmp/pup-sysinfo.txt > /tmp/${USER}/PSI-SYS-COMPLETE-$SYSDATE
	cat /tmp/pup-sysinfo.txt | gzip -f > /tmp/${USER}/PSI-SYS-COMPLETE-$SYSDATE.gz
	;;

-sysinfo_country)
	echo -e "$(gettext 'Language:') $DEF_LANG" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Keyboard:') `cat /etc/keymap`" >> /tmp/pup-sysinfo.txt
	if [ -x $HOME/Startup/numlockx ]; then
	 if grep -E 'numlockx on' $HOME/Startup/numlockx; then
	   echo "$(gettext 'Num-Lock: on')" >> /tmp/pup-sysinfo.txt
	 elif grep -E 'numlockx off' $HOME/Startup/numlockx; then
	   echo "$(gettext 'Num-Lock: off')" >> /tmp/pup-sysinfo.txt
	 fi
	fi
	echo -e "$(gettext 'Timezone:') `readlink /etc/localtime | sed -e 's%^.*share/zoneinfo/%%'`" >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_countrylocale)
	LANG=$DEF_LANG
	locale | grep -v '^LANG' | sed 's/\"//g' >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_cpu)
	CPU_MHz="`cat /proc/cpuinfo | grep 'MHz' | awk '{print $4}' | cut -d '.' -f1`"
	CORE=0
	CPU_SPEED="Core "
	for ONE_CORE in $CPU_MHz; do
	 CPU_SPEED="$CPU_SPEED$CORE:$ONE_CORE MHz, "
	 CORE=$(expr $CORE + 1)
	done
	CORE_SPEED="`echo -e "$(gettext 'Current Speed of') $CPU_SPEED"`"
	grep -m 1 'model name' /proc/cpuinfo | sed -e 's/model name	: //g' -e 's/  */\ /g' > /tmp/sysinfo-cpu
	dmidecode -t 4 | grep -E 'Socket Designation:|Manufacturer:|Voltage:|External Clock:|Max Speed:|Current Speed:|Core Count:|Thread Count:|capable' | sed -e 's/	//g' -e 's/^.*Current Speed.*$/'"$CORE_SPEED"'/' -e 's/[ \t]*$//' -e 's/  /  Core /g' -e 's/,$//' >> /tmp/sysinfo-cpu
	if [ "`which acpitool`" ] && [ "`acpitool -c | grep 'scaling'`" ]; then
	 echo -e "\n`acpitool -c | grep -E 'Min|governor|driver' | sed -e 's/^[ \t]*//' -e 's/  :/:/g'`" >> /tmp/sysinfo-cpu
	else
	 [ "`cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 2>/dev/null`" ] && echo -e "\n$(gettext 'Frequency governor   :') `cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sort -u`" >> /tmp/sysinfo-cpu
	 [ "`cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver 2>/dev/null`" ] && echo -e "$(gettext 'Freq. scaling driver :') `cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver | sort -u`" >> /tmp/sysinfo-cpu
	fi
	;;

-sysinfo_distro)
	. /etc/DISTRO_SPECS
	echo -e "\n$(gettext 'Distro:') $DISTRO_NAME $DISTRO_VERSION" >> /tmp/pup-sysinfo.txt
	[ "`pidof fbpanel`" ] && echo "$(gettext 'Desktop Panel:') `fbpanel --version`" >> /tmp/pup-sysinfo.txt
	[ "`pidof lxpanel`" ] && [ ! "$DISTRO_NAME" = "Fatdog64" ] && echo "$(gettext 'Desktop Panel:') `lxpanel --version`" >> /tmp/pup-sysinfo.txt
	[ "`pidof lxpanelx`" ] && echo "$(gettext 'Desktop Panel:') `lxpanelx --version | sed 's/lxpanel/lxpanelx/'`" >> /tmp/pup-sysinfo.txt
	[ "`pidof lxpanel.bin`" ] && [ ! "$DISTRO_NAME" = "Fatdog64" ] && echo "$(gettext 'Desktop Panel:') `lxpanel.bin --version`" >> /tmp/pup-sysinfo.txt
	[ "`pidof tint2`" ] && echo "$(gettext 'Desktop Panel:') `tint2 -v`" >> /tmp/pup-sysinfo.txt
	[ "`pidof xfce4-panel`" ] && echo "$(gettext 'Desktop Panel:') `xfce4-panel --version | grep xfce4-panel`" >> /tmp/pup-sysinfo.txt
	[ "`pidof enlightenment`" ] && echo "$(gettext 'Desktop Environment: Enlightenment')" >> /tmp/pup-sysinfo.txt
	[ "`pidof fluxbox`" ] && echo "$(gettext 'Window Manager:') `fluxbox -version | grep Fluxbox | cut -d " " -f1,2`" >> /tmp/pup-sysinfo.txt
	[ "`pidof icewm`" ] && echo "$(gettext 'Window Manager:') `icewm -v | cut -d "," -f1`" >> /tmp/pup-sysinfo.txt
	[ "`pidof jwm`" ] && echo "$(gettext 'Window Manager:') `jwm -v | grep JWM | cut -d " " -f1,2`" >> /tmp/pup-sysinfo.txt
	[ "`pidof metacity`" ] && echo "$(gettext 'Window Manager:') `metacity --version | grep metacity`" >> /tmp/pup-sysinfo.txt
	[ "`pidof openbox`" ] && echo "$(gettext 'Window Manager:') `openbox --version | grep Openbox`" >> /tmp/pup-sysinfo.txt
	[ "`pidof xfwm4`" ] && echo "$(gettext 'Window Manager:') `xfwm4 --version | grep xfwm4 | cut -d " " -f3,5`" >> /tmp/pup-sysinfo.txt
	[ "$CURRWM" = "startkde" ] && echo "$(gettext 'Desktop Environment: KDE')" >> /tmp/pup-sysinfo.txt
	[ "$CURRWM" = "startfusion" ] && echo "$(gettext 'Desktop Environment: Fusion')" >> /tmp/pup-sysinfo.txt
	echo "$(gettext 'Desktop Start:') xwin $CURRWM" >> /tmp/pup-sysinfo.txt
	echo -e "\n$(gettext 'Development:')" >> /tmp/pup-sysinfo.txt
	[ "`which bash 2>/dev/null`" ] && BASH=$(echo ${BASH_VERSION%%[^0-9.]*}) && echo " Bash: $BASH" >> /tmp/pup-sysinfo.txt
	[ "`which geany 2>/dev/null`" ] && GEANY=$(geany -V | awk '{print $2}') && echo " Geany: $GEANY" >> /tmp/pup-sysinfo.txt
	[ "`which gtkdialog 2>/dev/null`" ] && GTKD=$(gtkdialog -v | head -n1 | awk '{print $3}') && echo " Gtkdialog: $GTKD" >> /tmp/pup-sysinfo.txt
	[ "`which perl 2>/dev/null`" ] && PERL=$(perl -v | grep built | sed -e 's/built.*$/built/' -e 's/built//' | tr -d 'v()*' | awk -F' ' '{print $NF}') && echo " Perl: $PERL" >> /tmp/pup-sysinfo.txt
	[ "`which python 2>/dev/null`" ] && PYTHON=$(python -c 'print __import__("sys").version' | head -n1 | cut -f1 -d ' ') && echo " Python: $PYTHON" >> /tmp/pup-sysinfo.txt
	[ "`which yad 2>/dev/null`" ] && YAD=$(yad --version) && echo " Yad: $YAD" >> /tmp/pup-sysinfo.txt
	[ "`which java 2>/dev/null`" ] && JAVA=$(java -version 2>&1 | head -n1 | awk -F'"' '{print $2}') && echo " Java: $JAVA" >> /tmp/pup-sysinfo.txt
	echo " --" >> /tmp/pup-sysinfo.txt
	[ "`which busybox 2>/dev/null`" ] && BUSYBOX=$(busybox --help | head -n1 | awk '{print $2}' | tr -d 'v') && echo " busybox: $BUSYBOX" >> /tmp/pup-sysinfo.txt
	[ "`which dhcpcd 2>/dev/null`" ] && DHCPCD=$(dhcpcd --version | head -n1 | awk -F' ' '{print $NF}') && echo " dhcpcd: $DHCPCD" >> /tmp/pup-sysinfo.txt
	[ "`which gcc 2>/dev/null`" ] && GCC=$(gcc --version | head -n1 | awk -F' ' '{print $NF}') && echo " GCC: $GCC" >> /tmp/pup-sysinfo.txt
	GLIBC=$(ldd --version | head -n1 | awk -F' ' '{print $NF}') && echo " GlibC: $GLIBC" >> /tmp/pup-sysinfo.txt
	if [ "`which openssl 2>/dev/null`" ]; then
	 OSSLversion=$(openssl version | cut -f2- -d ' ')
	 OSSLbuilddate=$(openssl version -b)
	 echo " OpenSSL: $OSSLversion, $OSSLbuilddate" >> /tmp/pup-sysinfo.txt
	fi
	[ "`which wpa_supplicant 2>/dev/null`" ] && WPA_SUPPLICANT=$(wpa_supplicant -v | head -n1 | awk -F' ' '{print $NF}' | tr -d 'v') && echo " wpa_supplicant: $WPA_SUPPLICANT" >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_drivetest)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	if [ "$DISTRO_NAME" = "Lighthouse64" ]; then
	 DRIVES=$(grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Description: | sed -e 's%\/root\/.pup_event\/drive_%%g' -e 's%\/AppInfo.xml:%%g' -e 's/<Summary>.*Description:/<Summary> Description:/g' -e 's%  <Summary> %%g' -e 's%Description:%	%g' -e 's%<\/Summary>%%g')
	else
	 DRIVES=$(grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Description: | sed -e 's%\/root\/.pup_event\/drive_%%g' -e 's%\/AppInfo.xml:%%g' -e 's%  <Summary>Description:%	%g' -e 's%<\/Summary>%%g')
	fi
	echo -e "▶—— $(gettext 'DRIVE READ-SPEED') (hdparm -t --direct) ——◀" > /tmp/sysinfo-drivetest
	OLDIFS=$IFS
	IFS=$'\n'
	for DRIVE in $DRIVES
	 do
	  DESCRIPTION=$(echo "$DRIVE" | cut -d ':' -f1 | sed -e 's/	/:/g' -e 's/ Size//g')
	  PARTITION=$(echo "$DRIVE" | awk '{print $1}')
	  hdparm -t --direct /dev/$PARTITION 2>/dev/null > /tmp/sysinfo-drivetest2
	  if [ "`grep O_DIRECT /tmp/sysinfo-drivetest2 2>/dev/null`" ]; then
	   echo -e "$DESCRIPTION\n    `grep O_DIRECT /tmp/sysinfo-drivetest2 | cut -d ":" -f2 | tr -s ' '`" >> /tmp/sysinfo-drivetest
	   NOTE=""
	  else
	   echo -e "$DESCRIPTION\n    `hdparm -t /dev/$PARTITION | grep buffered | cut -d ":" -f2 | tr -s ' '`" >> /tmp/sysinfo-drivetest  
	   NOTE=`echo -e "\n$(gettext "Note: The hdparm utility of this distro does not support the\n'--direct' flag, which means the read speed is assessed from\nthe page cache rather than directly from each physical drive.")"`
	  fi
	 done
	 echo "$NOTE" >> /tmp/sysinfo-drivetest
	 sed -i '/:/{x;p;x;}' /tmp/sysinfo-drivetest
	 echo -e "\n$(gettext 'Test Date:') `date +'%a %-e %b %Y, %H:%M:%S'`" >> /tmp/sysinfo-drivetest
	 IFS=$OLDIFS
	kill $XPID
	;;

-sysinfo_extraSFS)
	echo -e "▶—— $(gettext 'INSTALLED SFS FILES') (losetup) ——◀\n" > /tmp/pup-sysinfo.txt
	if [ "`losetup | grep -Ev 'loop[0-3]'`" ]; then
	 losetup | grep -Ev 'loop[0-3]' | awk -F'/' '{print $NF}' | sort >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No installed (add-on) SFS files are detected.')" >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_filesystems) df -h | (read -r; printf "%s\n" "$REPLY"; sort $VER) >> /tmp/pup-sysinfo.txt ;;

-sysinfo_fonts)
	echo -e "▶—— $(gettext 'Fonts') ——◀\n" > /tmp/pup-sysinfo.txt
	echo "`fc-list : family | sort | uniq`" >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_hardware)
	. /etc/DISTRO_SPECS
	. $WORKDIR/func -sysinfo_pci
	. $WORKDIR/func -sysinfo_storage
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	echo -e "$(gettext 'Pup-SysInfo Hardware Report (Complete),') `date +'%a %-e %b %Y'`" > /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_uptime
	echo -e "\n▶—— $(gettext 'BASE SYSTEM') ——◀\n" >> /tmp/pup-sysinfo.txt
	dmidecode -t 1 | grep -E 'Manufacturer:|Product Name:|Serial Number:|UUID:' | sed -e 's/Manufacturer:/PC Manufacturer:/g' -e 's/	//g' >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	dmidecode -t 2 | grep -E 'Manufacturer:|Product Name:|Serial Number:|Version' | sed -e 's/Manufacturer:/Motherboard Vendor:/g' -e 's/	//g' >> /tmp/pup-sysinfo.txt
	echo -e "\n$(gettext 'Linux Kernel:') `uname -r` (`uname -m`)" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Version:') `uname -v`" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_kernelpae
	. $WORKDIR/func -sysinfo_distro
	echo -e "\n$(gettext 'Username:') "`whoami`"" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_country
	. $WORKDIR/func -sysinfo_netsummary
	echo >> /tmp/pup-sysinfo.txt
	cat /tmp/sysinfo-network >> /tmp/pup-sysinfo.txt
	SAVESIZE=`df -h | grep dev_save | awk '{print $2}'`
	SAVEFREE=`df -h | grep dev_save | awk '{print $4}'`
	[ "$SAVESIZE" ] && SAVESIZEFREE="($(gettext 'Size') $SAVESIZE, $(gettext 'Free') $SAVEFREE)"
	[ "$PUPMODE" = "12" -o "$PUPMODE" = "13" ] && SAVEPARTSPACE="$SAVESIZEFREE"
	echo >> /tmp/pup-sysinfo.txt
	[ "$SAVESIZE" ] && echo -e "$(gettext 'Boot Partition:') $BOOTPART $SAVEPARTSPACE" >> /tmp/pup-sysinfo.txt
	[ "$DEV1FS" ] && echo -e "$(gettext 'Boot File System:') $BOOTFS" >> /tmp/pup-sysinfo.txt
	[ "$PMEDIA" ] && echo -e "$(gettext 'Boot Media:') $BOOTMEDIA" >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	grep -E '^PUPMODE|^PUPSFS|^PUPSAVE' /etc/rc.d/PUPSTATE | sed s/\'//g >> /tmp/pup-sysinfo.txt
	[ "`grep SAVEFILE_PATH /etc/BOOTSTATE 2>/dev/null`" ] && echo -e "`grep SAVEFILE_PATH /etc/BOOTSTATE`" >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'BIOS') ——◀\n" >> /tmp/pup-sysinfo.txt
	dmidecode -t 0 | grep -E 'Vendor:|Version:|Release Date:|Runtime Size:|ROM Size:' | sed 's/	//g' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'CENTRAL PROCESSOR') ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_cpu
	cat /tmp/sysinfo-cpu >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_sensors
	cat /tmp/sysinfo-sensors >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_memory
	cat /tmp/sysinfo-memory >> /tmp/pup-sysinfo.txt
	echo -e "\n$(gettext 'Memory Statistics:')" >> /tmp/pup-sysinfo.txt
	cat /proc/meminfo | sed 's/^/ /g' >> /tmp/pup-sysinfo.txt
	echo -e "\n—— $(gettext 'Physical Memory') ——\n" >> /tmp/pup-sysinfo.txt
	dmidecode -t 5 | grep -E 'Memory Controller|Size:|Voltage:' | sed 's/	/ /g' >> /tmp/pup-sysinfo.txt
	[ "`dmidecode -t 19 | grep -E 'Range Size:' | grep -Ei 'MB|GB'`" ] && dmidecode -t 19 | grep -E 'Range Size:' | sed -e 's/	//g' -e 's/Range Size:/Installed Memory:/g' >> /tmp/pup-sysinfo.txt
	dmidecode -t 16 | grep -E 'Maximum Capacity:|Number Of Devices:' | sed -e 's/	//g' -e 's/Capacity:/Memory:/g' -e 's/Devices:/Slots:/g' >> /tmp/pup-sysinfo.txt
	dmidecode -t 17 | grep -E 'Memory Device|Data Width:|Size:|Form Factor:|	Locator:|Type|Speed:|Manufacturer:|Asset Tag:|Number:' | sed -e 's/	/ /g' -e '/Memory Device/{x;p;x;}' | awk '/Device/{c++;if(c==1){sub("Device","Module 1")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 2")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 3")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 4")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 5")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 6")}}1' >> /tmp/pup-sysinfo.txt
	dmidecode -t 7 | grep -E 'Cache Information|Configuration:|Installed Size:' | sed -e 's/	/ /g' -e '/Cache Information/{x;p;x;}' | awk '/Cache Information/{c++;if(c==1){sub("Cache Information","Internal Cache")}}1' | awk '/Cache Information/{c++;if(c==1){sub("Cache Information","External Cache")}}1' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'COMPUTER RESOURCES') ——◀" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_io
	cat /tmp/sysinfo-io | grep -v '▶' | sed '$!N; /^\(.*\)\n\1$/!P; D' >> /tmp/pup-sysinfo.txt
	if [ "`which smbclient`" ]; then
	 echo -e "\n▶—— $(gettext 'NETWORK (SAMBA) SHARED RESOURCES') ——◀" >> /tmp/pup-sysinfo.txt
	 . $WORKDIR/func -sysinfo_samba
	 cat /tmp/sysinfo-samba | sed -e '/▶/d' >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'DEVICES: INPUT') ——◀\n" >> /tmp/pup-sysinfo.txt
	grep -Ev 'S:|U:|H:|B:' /proc/bus/input/devices | sed -e 's/I: //g' -e 's/N: //g' -e 's/P: //g' -e 's/Phys=/Connected to: /g' -e 's/[©®–"]//g' >> /tmp/pup-sysinfo.txt
	echo -e "▶—— $(gettext 'DEVICES: MONITOR/VIDEO') ——◀\n" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Display Specifications:')" >> /tmp/pup-sysinfo.txt
	ddcprobe | grep -E 'monitorserial:' | sed -e 's/monitorserial:/• Monitor Serial Number:/g' >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_videosummary
	echo -e "\n▶—— $(gettext 'DEVICES: MULTIMEDIA/SOUND') ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_audio
	cat /tmp/sysinfo-audio >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'DEVICES: NETWORK') ——◀" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_netdevices
	cat /tmp/sysinfo-netdevices >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	if [ "$sysBAT" -o "$procBAT" ]; then
	 . $WORKDIR/func -sysinfo_bat0
	 cat /tmp/sysinfo-battery 2>/dev/null >> /tmp/pup-sysinfo.txt
	 [ "$BATTERY1" ] && echo >> /tmp/pup-sysinfo.txt
	 [ "$BATTERY1" ] && . $WORKDIR/func -sysinfo_bat1
	 [ "$BATTERY1" ] && cat /tmp/sysinfo-battery 2>/dev/null >> /tmp/pup-sysinfo.txt
	 echo >> /tmp/pup-sysinfo.txt
	fi
	echo -e "`cat /tmp/sysinfo-pci`" >> /tmp/pup-sysinfo.txt
	echo "`grep '<DefaultPrinter ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" > /tmp/sysinfo-printers
	echo "`grep '<Printer ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" >> /tmp/sysinfo-printers
	echo -e "\n▶—— $(gettext 'DEVICES: PRINTERS') ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`cat /tmp/sysinfo-printers`" ]; then
	 cat /tmp/sysinfo-printers | sed '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo -e " $(gettext 'No printers are detected in') /etc/cups/printers.conf. " >> /tmp/pup-sysinfo.txt
	fi
	. $WORKDIR/func -sysinfo_scsi
	. $WORKDIR/func -sysinfo_usb
	if [ "`lsusb`" ] && [ "`which usb-devices`" -o -f /proc/bus/usb/devices ]; then
	 echo -e "\n--\n" >> /tmp/sysinfo-usb
	 lsusb >> /tmp/sysinfo-usb
	fi
	cat /tmp/sysinfo-usb | sed 's/▶—— USB DEVICES/\n▶—— DEVICES: USB/'  >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'DRIVES: CD/DVD') ——◀" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_optical
	grep -E '/dev|Model Number:|Serial Number:|Firmware Revision:|Maximum read|Maximum write' /tmp/sysinfo-optical | sed -e 's/	//g' -e 's/\/dev\//Device Name:        /g' -e '/Device Name/{x;p;x;}' -e 's/sr0:/sr0/g' -e 's/sr1:/sr1/g' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'DRIVES: HDD') ——◀" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_hdd
	grep -E 'HDD|/dev|Model Number:|Serial Number:|Firmware Revision:|MBytes' /tmp/sysinfo-hdd | sed -e 's/	//g' -e '/HDD/d' -e '/——/d' -e 's/\/dev\//Device Name:        /g' -e '/Device Name/{x;p;x;}' -e 's/sda1/sda/g' -e 's/sdb1/sdb/g' -e 's/sdc1/sdc/g' -e 's/sdd1/sdd/g' -e 's/hda1/hda/g' -e 's/hdb1/hdb/g' -e 's/hdc1/hdc/g' -e 's/hdd1/hdd/g' >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'DRIVES: HDD-RAID') ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_raid
	echo -e "\n▶—— $(gettext 'DRIVES: PARTITIONS (HDD & USB)') ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_partitions
	cat /tmp/sysinfo-partitions >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'FILESYSTEMS') ——◀\n" >> /tmp/pup-sysinfo.txt
	df -h | (read -r; printf "%s\n" "$REPLY"; sort $VER) >> /tmp/pup-sysinfo.txt
	echo -e "\n=== $(gettext 'END OF HARDWARE REPORT') ===\n" >> /tmp/pup-sysinfo.txt
	SYSDATE="`date +'%y%m%d'`"
	PRIVATE=`cat $PREFDIR/psi_private 2>/dev/null`
	echo -e "$(gettext 'This report is also available in')\n/tmp/${USER}/PSI-HW-COMPLETE-$SYSDATE." >> /tmp/pup-sysinfo.txt
	[ "$PRIVATE" = "true" ] && grep -Ev 'Hostname:|Monthly Data:|Session Data:|Domain Name Server|External IP Address:|Hardware Address|Network IP Address:|Part Number:|SerialNumber|Serial Number|Username:|UUID:|Wireless Network:|Asset Tag:' /tmp/pup-sysinfo.txt > /tmp/tmp && mv -f /tmp/tmp /tmp/pup-sysinfo.txt && rm -f /tmp/sysinfo-private
	mkdir -p /tmp/${USER}/
	cat /tmp/pup-sysinfo.txt > /tmp/${USER}/PSI-HW-COMPLETE-$SYSDATE
	cat /tmp/pup-sysinfo.txt | gzip -f > /tmp/${USER}/PSI-HW-COMPLETE-$SYSDATE.gz
	kill $XPID
	;;

-sysinfo_hdd)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X11PID=$!
	rm -f /tmp/sysinfo-hdd 2>/dev/null
	for HDD in sda hda sdb hdb sdc hdc sdd hdd sde hde sdf hdf sdg hdg sdh hdh
	do
	 if [ "`hdparm -I /dev/"$HDD"1 2>/dev/null | grep 'ATA device'`" ] && [ "`hdparm -I /dev/"$HDD"1 2>/dev/null | grep 'Checksum:'`" ]; then
	   echo -e "\nHDD: "$HDD"\n========" >> /tmp/sysinfo-hdd
	   [ "`which smartctl 2>/dev/null`" ] && echo -e "\n`smartctl -H /dev/"$HDD" | grep overall-health | sed 's/result:/result: Drive '"$HDD"'/'`" >> /tmp/sysinfo-hdd
	   hdparm -I /dev/"$HDD"1 2>/dev/null | grep -Ev '' >> /tmp/sysinfo-hdd
	 fi
	done
	if [ ! "`cat /tmp/sysinfo-hdd 2>/dev/null`" ]; then
	 echo -e "\n$(gettext 'No Hard Drive detected.')" > /tmp/sysinfo-hdd
	fi
	kill $X11PID
	;;

-sysinfo_hddsmartctl)
	echo > /tmp/sysinfo-hddsmartctl
	for HDD in sda hda sdb hdb sdc hdc sdd hdd sde hde sdf hdf sdg hdg sdh hdh
	do
	 if [ "`hdparm -I /dev/"$HDD"1 2>/dev/null | grep 'ATA device'`" ] && [ "`hdparm -I /dev/"$HDD"1 2>/dev/null | grep 'Checksum:'`" ]; then
	   echo -e "\nHDD: "$HDD"\n========" >> /tmp/sysinfo-hddsmartctl
	   echo -e "`smartctl -A -H -i -l error /dev/"$HDD" | tail -n 1600 | grep -Ev 'tools|^smartctl|^Home|===' | sed 's/result:/result: Drive '"$HDD"'/'`" >> /tmp/sysinfo-hddsmartctl
	 fi
	done
	sed -i '2d' /tmp/sysinfo-hddsmartctl
	if [ ! "`cat /tmp/sysinfo-hddsmartctl 2>/dev/null`" ]; then
	 echo -e "\n$(gettext 'No Hard Drive detected.')" > /tmp/sysinfo-hddsmartctl
	fi
	;;

-sysinfo_history)
	echo -e "▶—— /root/.history ——◀\n" > /tmp/pup-sysinfo.txt
	if [ "`cat /root/.history 2>/dev/null`" ]; then
	 cat /root/.history | tail -n 1500 >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No command history is detected in') /root/.history." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_input)
	if [ "`cat /proc/bus/input/devices`" ]; then
	 echo -e "▶—— $(gettext 'Input Devices') ——◀\n" > /tmp/pup-sysinfo.txt
	 grep -Ev 'S:|U:|H:|B:' /proc/bus/input/devices | sed -e 's/I: //g' -e 's/N: //g' -e 's/P: //g' -e 's/Phys=/Connected to: /g' -e 's/[©®–"]//g' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No input devices are detected in') /proc/bus/input/devices." > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_io)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X9PID=$!
	echo -e "▶—— $(gettext 'I/O Memory') ——◀\n" > /tmp/sysinfo-io
	echo -e "MEMORY REGISTERS    USED BY" >> /tmp/sysinfo-io
	echo -e "================    =======" >> /tmp/sysinfo-io
	cat /proc/iomem | sed -e 's/^[ \t]*//' >> /tmp/sysinfo-io
	echo -e "\n▶—— $(gettext 'I/O Ports') ——◀\n" >> /tmp/sysinfo-io
	echo -e "COM PORTS   USED BY" >> /tmp/sysinfo-io
	echo -e "=========   =======" >> /tmp/sysinfo-io
	cat /proc/ioports | sed -e 's/^[ \t]*//' >> /tmp/sysinfo-io
	PCImap=`lspci | cut -d ' ' -f1`
	for p in $PCImap
	 do
	   PCIdescription=`lspci | grep -E "$p"`
	   sed -i 's%'":$p"'%'":$PCIdescription"'%g' /tmp/sysinfo-io
	 done
	kill $X9PID
	;;

-sysinfo_kernel)
	echo -e "▶—— $(gettext 'Linux Kernel') ——◀\n" > /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Kernel Release:') `uname -r`" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Build Date:') `uname -v`" | sed -e 's/#[0-9] SMP //g' -e 's/ PREEMPT//g' >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'OS Support:') `uname -o`" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Architecture:') `uname -m`" >> /tmp/pup-sysinfo.txt
	SMP=$(uname -v | grep 'SMP')
	[ "$SMP" ] && echo "$(gettext 'SMP Enabled: Yes')" >> /tmp/pup-sysinfo.txt || echo "$(gettext 'SMP Enabled: No')" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_kernelpae
	;;

-sysinfo_kernelpae)
	BIT32=$(grep -i '^CONFIG_X86_32=y' /etc/modules/DOTconfig* 2>/dev/null)
	if [ "$BIT32" ]; then
	  PAE=$(grep -i '^CONFIG_X86_PAE=y' /etc/modules/DOTconfig* 2>/dev/null)
	  [ "$PAE" ] && echo "$(gettext 'PAE Enabled: Yes')" >> /tmp/pup-sysinfo.txt || echo "$(gettext 'PAE Enabled: No')" >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_kmodules)
	KMODULE=$( cat /tmp/KMODULE.tmp )
	KMODSIZE=$( lsmod | grep -Ew ^$KMODULE | awk '{print $2}' )
	KMODSIZEr="$( expr $KMODSIZE \+ 5 )" #adjust for bc rounding
	KMODSIZE=$( echo "scale=2; $KMODSIZEr / 1024" | bc )
	GTET1=$( echo "$KMODSIZE" | grep '[0-9]\.' )
	[ ! "$GTET1" ] && KMODSIZE=$( echo "0$KMODSIZE" )
	echo -e "Module Name:    $KMODULE" > /tmp/sysinfo-kernel
	echo -e "Memory Used:    $KMODSIZE KB" >> /tmp/sysinfo-kernel
	modinfo $KMODULE | grep -Ev '^alias:|^parm:' | sed \
	-e 's/filename:/path:    /' \
	-e 's/depends:     /dependencies:/' \
	-e 's/intree:  /built-in:/' \
	-e 's/   Y/   Yes/' \
	-e 's/vermagic:     /Version Magic:/' \
	-e 's/parm:     /Parameter:/' \
	-e 's/,/, /g' | sed 's/^\(.\)/\U\1/' >> /tmp/sysinfo-kernel
	USEDBY=$( lsmod | grep -Ew ^$KMODULE | sed 's/^.\{,30\}//' )
	echo -e "Used by:        $USEDBY" | sed 's/,/, /g' >> /tmp/sysinfo-kernel
	DESCRIPTION=$( cat /tmp/sysinfo-kernel | grep Description: )
	[ ! "$DESCRIPTION" ] && echo "Description:    N/A" >> /tmp/sysinfo-kernel
	DEPENDS=$( modinfo $KMODULE | grep ^depends: | sed 's/^.\{,16\}//' )
	[ ! "$DEPENDS" ] && grep -v Dependencies: /tmp/sysinfo-kernel > /tmp/tmp && mv -f /tmp/tmp /tmp/sysinfo-kernel
	;;

-sysinfo_kmodblacklist)
	echo -e "▶—— $(gettext 'Kernel Module Black List') (/etc/modprobe.d/blacklist.conf) ——◀\n" > /tmp/sysinfo-kernel
	if [ "`cat /etc/modprobe.d/blacklist.conf 2>/dev/null`" ]; then
	 cat /etc/modprobe.d/blacklist.conf | awk -F' ' '{print $NF}' | sort >> /tmp/sysinfo-kernel
	else
	 echo "$(gettext 'No kernel modules detected in') /etc/modprobe.d/blacklist.conf" >> /tmp/sysinfo-kernel
	fi
	;;

-sysinfo_kmodcomplete)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	KMODNUM=$( lsmod | grep -v Module | wc -l )
	echo -e "▶—— "$KMODNUM" $(gettext 'Loaded Kernel Modules') (modinfo) ——◀" > /tmp/sysinfo-kernel
	KMODULES=$( lsmod | awk -F" " '{print $1}' | grep -v Module | sort )
	for KMODULE in $KMODULES
	 do
	   KMODSIZE=$( lsmod | grep -Ew ^$KMODULE | awk '{print $2}' )
	   KMODSIZEr=$( expr $KMODSIZE \+ 5 )
	   KMODSIZE=$( echo "scale=2; $KMODSIZEr / 1024" | bc )
	   GTET1=$( echo "$KMODSIZE" | grep '[0-9]\.' )
	   [ ! "$GTET1" ] && KMODSIZE=$( echo "0$KMODSIZE" )
	   echo -e "Module Name:    $KMODULE" >> /tmp/sysinfo-kernel2
	   echo -e "Memory Used:    $KMODSIZE KB" >> /tmp/sysinfo-kernel2
	   modinfo $KMODULE >> /tmp/sysinfo-kernel2
	   USEDBY=$( lsmod | grep -Ew ^$KMODULE | sed 's/^.\{,30\}//' )
	   echo -e "Used by:        $USEDBY" | sed 's/,/, /g' >> /tmp/sysinfo-kernel2
	 done
	cat /tmp/sysinfo-kernel2 | sed -e 's/Module Name:/\n--\n\nModule Name:/' -e 's/filename:/path:    /' -e 's/depends:     /dependencies:/' -e 's/intree:  /built-in:/' -e 's/   Y/   Yes/' -e 's/vermagic:     /Version Magic:/' -e 's/parm:     /Parameter:/' -e 's/,/, /g' | sed 's/^\(.\)/\U\1/' | sed '2,3d' >> /tmp/sysinfo-kernel
	rm -f /tmp/sysinfo-kernel2 &
	kill $XPID
	;;

-sysinfo_kmodsummary)
	KMODNUM=$( lsmod | grep -v Module | wc -l )
	KMODMEM=$( lsmod | grep -v Module | awk '{total = total + $2}END{print total}' ) #summate 2nd column = total memory used
	KMODMEMr=$( expr $KMODMEM \+ 5 ) #adjust for bc rounding
	KMODMEM=$( echo "scale=2; $KMODMEMr / 1024" | bc )
	echo -e "▶—— "$KMODNUM" $(gettext 'Loaded Kernel Modules') (lsmod) ——◀\n" > /tmp/sysinfo-kernel
	echo -e "$(gettext 'Total Memory Used:') "$KMODMEM" KB\n" >> /tmp/sysinfo-kernel
	. $WORKDIR/func -sysinfo_lsmod
	;;

-sysinfo_lighthouse)
	SYSDATE="`date +'%y%m%d'`"
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Processing Lighthouse Sys-Info...') " &
	X3PID=$!
	mkdir -p /tmp/${USER}/
	sys-info -q > /tmp/${USER}/sys-info-$SYSDATE #TazOC script support
	sleep .3
	cat /tmp/${USER}/sys-info-$SYSDATE | head -n 2500 | sed -e 's/[©®–]//g' -e '1i\"'"The Lighthouse full-system report is also\n available here: /tmp/${USER}/sys-info-$SYSDATE"'"\n' > /tmp/${USER}/sys-info2-$SYSDATE
	mv -f /tmp/${USER}/sys-info2-$SYSDATE /tmp/pup-sysinfo.txt
	kill $X3PID
	;;

-sysinfo_log)
	if [ "`cat /var/log/messages`" ]; then
	 echo -e "▶—— $(gettext 'System Activity Log') (/var/log/messages) ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /var/log/messages | tail -n 1000 | sed -e '/./,/^$/!d' -e 's/[©®–]//g' >> /tmp/pup-sysinfo.txt
	elif [ "`which journalctl.sh 2>/dev/null`" ]; then ##sfs
	 journalctl-gui #&
	 echo -e "▶—— $(gettext 'System Activity Log (journalctl)') ——◀\n" > /tmp/pup-sysinfo.txt
	 journalctl | tail -n 1000 | sed -e '/./,/^$/!d' -e 's/[©®]//g' >> /tmp/pup-sysinfo.txt
	elif [ "`which journalctl 2>/dev/null`" ]; then ##sfs
	 echo -e "▶—— $(gettext 'System Activity Log (journalctl)') ——◀\n" > /tmp/pup-sysinfo.txt
	 journalctl | tail -n 1000 | sed -e '/./,/^$/!d' -e 's/[©®]//g' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in') /var/log/messages." > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_login)
	[ "`which last`" ] && last > /tmp/pup-sysinfo.txt
	CURRLOGIN=`cat /tmp/pup-sysinfo.txt | sed 's/^.*wtmp.*$//'`
	if [ "`which last`" ] && [ ! "$CURRLOGIN" ]; then
	 echo "$(gettext 'No information is detected in a report')" > /tmp/pup-sysinfo.txt 
	 echo "$(gettext "generated by the Linux 'last' command.")" >> /tmp/pup-sysinfo.txt
	elif [ "`which last`" ] && [ "$CURRLOGIN" ]; then
	 xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	 X8PID=$!
	 echo -e "▶—— $(gettext 'User Login Report') ——◀\n" > /tmp/pup-sysinfo.txt
	 echo "User     Terminal        Date    Login   Logout Logtime     Remote Host" >> /tmp/pup-sysinfo.txt
	 echo "====     ========     ========== =====   ====== =======     ===========" >> /tmp/pup-sysinfo.txt
	 if [ "`last -adn 1500`" ]; then
	  last -adn 1500 >> /tmp/pup-sysinfo.txt
	 else
	  echo -e "▶—— $(gettext 'User Login Report') ——◀\n\n" > /tmp/pup-sysinfo.txt && last 2000 >> /tmp/pup-sysinfo.txt
	 fi
	 kill $X8PID
	elif [ ! "`which last`" ]; then
	 echo "$(gettext "This Distro has no Linux 'last' command to create a login report.") " > /tmp/pup-sysinfo.txt 
	fi
	;;

-sysinfo_lsmod) lsmod 2>/dev/null | (read -r; printf "%s\n" "$REPLY"; sort) | sed -e 's/Module /MODULE:/' -e 's/ Size/BYTES/' -e 's/Used by/USED BY/' >> /tmp/sysinfo-kernel ;;

-sysinfo_memory)
	. $WORKDIR/func -sysinfo_storage
	echo -e "▶—— $(gettext 'COMPUTER MEMORY') ——◀\n" > /tmp/sysinfo-memory
	if [ "$PUPMODE" = "5" -o "$PUPMODE" = "77" ]; then
	 echo "$(gettext 'Personal Storage: RAM Disk')" >> /tmp/sysinfo-memory
	 df -h | awk '/Filesystem|tmpfs.*pup_rw/' | awk '{print $2,$3,$4,$5}' | sed -e 's/ / 	/g' -e 's/^/ /g' -e 's/Avail/Free/g' >> /tmp/sysinfo-memory
	 echo >> /tmp/sysinfo-memory
	fi
	if [ "$PERSISTMNTPT" ]; then
	 echo "$(gettext 'Personal Storage File:')" >> /tmp/sysinfo-memory
	 echo " $(gettext 'Name:') $NAMEPFILE" >> /tmp/sysinfo-memory
	 echo " $(gettext 'Total Size:') $ACTUALSIZE MB" >> /tmp/sysinfo-memory
	 echo " $(gettext 'Free Space:') $SIZEFREE MB" >> /tmp/sysinfo-memory
	 echo -e " $(gettext 'Location: partition') $SAVEPART\n" >> /tmp/sysinfo-memory
	fi
	[ "$DISTRO_NAME" = "Fatdog64" ] && echo -e "▶—— $(gettext 'COMPUTER MEMORY') ——◀\n" > /tmp/sysinfo-memory #exclude personal storage file assessment in Fatdog64
	echo "$(gettext 'Memory Allocation:')" >> /tmp/sysinfo-memory
	echo " $(gettext 'Total RAM:') $MEMTOTAL MB" >> /tmp/sysinfo-memory
	echo " $(gettext 'Used RAM:') $MEMUSED MB" >> /tmp/sysinfo-memory
	echo " $(gettext 'Free RAM:') $MEMFREE MB" >> /tmp/sysinfo-memory
	echo " $(gettext 'Buffers:') $BUFFERS MB" >> /tmp/sysinfo-memory
	echo " $(gettext 'Total Swap:') $SWAPTOTAL MB" >> /tmp/sysinfo-memory
	echo " $(gettext 'Free Swap:') $SWAPFREE MB" >> /tmp/sysinfo-memory
	;;

-sysinfo_memory2)
	echo -e "\n$(gettext 'Memory Stats') (/proc/meminfo):" >> /tmp/sysinfo-memory
	cat /proc/meminfo | sed 's/^/ /g' >> /tmp/sysinfo-memory
	echo -e "\n▶—— $(gettext 'PHYSICAL MEMORY') ——◀\n" >> /tmp/sysinfo-memory
	dmidecode -t 5 | grep -E 'Memory Controller|Size:|Voltage:' | sed 's/	/ /g' >> /tmp/sysinfo-memory
	[ "`dmidecode -t 19 | grep -E 'Range Size:' | grep -Ei 'MB|GB'`" ] && dmidecode -t 19 | grep -E 'Range Size:' | sed -e 's/	//g' -e 's/Range Size:/Installed Memory:/g' >> /tmp/sysinfo-memory
	dmidecode -t 16 | grep -E 'Maximum Capacity:|Number Of Devices:' | sed -e 's/	//g' -e 's/Capacity:/Memory:/g' -e 's/Devices:/Slots:/g' >> /tmp/sysinfo-memory
	dmidecode -t 17 | grep -E 'Memory Device|Data Width:|Size:|Form Factor:|	Locator:|Type|Speed:|Manufacturer:|Asset Tag:|Number:' | sed -e 's/	/ /g' -e '/Memory Device/{x;p;x;}' | awk '/Device/{c++;if(c==1){sub("Device","Module 1")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 2")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 3")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 4")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 5")}}1' | awk '/Device/{c++;if(c==1){sub("Device","Module 6")}}1' >> /tmp/sysinfo-memory
	dmidecode -t 7 | grep -E 'Cache Information|Configuration:|Installed Size:' | sed -e 's/	/ /g' -e '/Cache Information/{x;p;x;}' | awk '/Cache Information/{c++;if(c==1){sub("Cache Information","Internal Cache")}}1' | awk '/Cache Information/{c++;if(c==1){sub("Cache Information","External Cache")}}1' >> /tmp/sysinfo-memory
	;;

-sysinfo_netdevices)
	echo > /tmp/sysinfo-netdevices
	if [ "`lspci -knn`" ]; then
	 NETDEVICES=`lspci -knn | grep -iv Subsystem: | sed -e 's/driver in use/• Kernel Driver/g' -e 's/modules/• Kernel Module/g' | cut -d " " -f2- | sed '/./,/^$/!d' | grep -EA1 'Ethernet|Network'`
	 NETDRIVERS=`echo "$NETDEVICES" | grep '• Kernel Driver' | awk -F' ' '{print $NF}'`
	 if [ "$NETDRIVERS" ]; then
	  for DRIVER in $NETDRIVERS
	   do
	     echo "$NETDEVICES" | grep -EB1 "$DRIVER" >> /tmp/sysinfo-netdevices
	     echo "$DRIVER" > /tmp/KMODULE.tmp
	     . $WORKDIR/func -sysinfo_kmodules
	     if [ "`lsmod | grep "$DRIVER"`" ]; then
	      cat /tmp/sysinfo-kernel | grep -E 'Memory Used:|Path:|Description:|^Version:' | tr -s ' ' | sed -e 's/Memory Used/• Memory Used/' -e 's/Path/• Path/' -e 's/Description/• Description/' -e 's/Version/• Driver Version/' >> /tmp/sysinfo-netdevices
	     fi
	     echo >> /tmp/sysinfo-netdevices
	   done
	 sed -i '$d' /tmp/sysinfo-netdevices
	 else
	  echo > /tmp/sysinfo-netdevices
	  lspci -nn | grep -E 'Ethernet|Network' | sed -r 's/^[^ \t]*[ \t]+//g' >> /tmp/sysinfo-netdevices
	 fi
	else
	 echo > /tmp/sysinfo-netdevices
	 lspci -nn | grep -E 'Ethernet|Network' | sed -r 's/^[^ \t]*[ \t]+//g' >> /tmp/sysinfo-netdevices
	fi
	if [ "`lsusb -v | grep iProduct | grep -Ei 'network|wlan'`" ]; then
	 echo -e "--\n$(gettext 'USB network adapter :') `lsusb -v | grep iProduct | grep -Ei 'network|wlan' | awk '{$1=$2=""; print $0}' | sed -e 's/^[ \t]*//' -e '/^ *$/d' | tr -d '[©®–]' | sort`" >> /tmp/sysinfo-netdevices
	elif [ "`which usb-devices`" ] && [ "`usb-devices | grep -Ei 'network|wlan'`" ]; then
	 echo -e "--\n$(gettext 'USB network adapter :') `usb-devices | grep -Ei 'network|wlan' | sed -e 's/S:  //g' -e 's/Product=//g' -e 's/[©®–]//g'`" >> /tmp/sysinfo-netdevices
	elif [ -f /proc/bus/usb/devices ] && [ "`grep -Ei 'network|wlan' /proc/bus/usb/devices`" ]; then
	 echo -e "--\n$(gettext 'USB network adapter :') `grep -Ei 'network|wlan' /proc/bus/usb/devices | sed -e 's/S:  //g' -e 's/Product=//g' -e 's/[©®–]//g'`" >> /tmp/sysinfo-netdevices
	fi
	;;

-sysinfo_netcomplete)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X6PID=$!
	echo -e "\n\n▶$(gettext 'TCP/IP Network Interfaces:')\n" >> /tmp/sysinfo-network
	ifconfig | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' >> /tmp/sysinfo-network
	echo -e "\n\n▶$(gettext 'Kernel IP Routing Table:')\n" >> /tmp/sysinfo-network
	route -n | sed '/Kernel IP routing table/d' >> /tmp/sysinfo-network
	netstat -tan | sed -e 's/Active Internet connections/\n\n▶Active Internet Connections:/' | sed '/Proto/{x;p;x;G;}' >> /tmp/sysinfo-network
	echo -e "\n\n▶$(gettext 'Network Protocol Statistics:')\n`netstat -s | sed -e 's/^I/\nI/g' -e 's/^U/\nU/g' -e 's/^T/\nT/g'`" >> /tmp/sysinfo-network
	PRIVATE=`cat $PREFDIR/psi_private 2>/dev/null`
	[ "$PRIVATE" = "true" ] && grep -Ev 'Hostname:|Monthly Data:|Session Data:|Domain Name Server|External IP Address:|Hardware Address|Network IP Address:|Part Number:|SerialNumber|Serial Number|Username:|UUID:|Wireless Network:|Asset Tag:' /tmp/sysinfo-network > /tmp/tmp && mv -f /tmp/tmp /tmp/sysinfo-network
	kill $X6PID
	;;

-sysinfo_netsummary)
	QUERY=`cat $PREFDIR/psi_query 2>/dev/null`
	[ ! "$QUERY" ] && QUERY="false"
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X4PID=$!
	IFACE=""
	IFACE="`ifconfig | grep '^[a-z]' | grep -v '^lo' | grep 'Link encap:Ethernet' | cut -d ' ' -f1 | head -n1`"
	IFACE2="`ifconfig | grep '^[a-z]' | grep -v '^lo' | grep 'Link encap:Ethernet' | cut -d ' ' -f1 | tail -n1`"
	INETADDRESS="`ifconfig | grep -A7 $IFACE | grep 'inet addr' | cut -d ":" -f2 | cut -d " " -f1`"
	[ ! "$INETADDRESS" ] && IFACE="$IFACE2"
	if [ "$IFACE" ]; then 
	 CURRENTRX="`cat /sys/class/net/$IFACE/statistics/rx_bytes`"
	 CURRENTTX="`cat /sys/class/net/$IFACE/statistics/tx_bytes`"
	 SESSIONRX="`ifconfig | grep -A7 $IFACE | grep 'RX bytes' | sed 's/iB/B/g' | tr -s ' ' | awk '{print $3,$4}'`"
	 [ ! "$SESSIONRX" ] && SESSIONRX="$(expr $(expr $CURRENTRX + 524288) \/ 1048576) MB"
	 SESSIONTX="`ifconfig | grep -A7 $IFACE | grep 'TX bytes' | sed 's/iB/B/g' | tr -s ' ' | awk '{print $7,$8}'`"
	 [ ! "$SESSIONTX" ] && SESSIONTX="$(expr $(expr $CURRENTTX + 524288) \/ 1048576) MB"
	 MONTHRX="`cat /var/local/sns/rx_bytes_month`"
	 MONTHRX="$(expr $(expr $MONTHRX + 524288) \/ 1048576 + $(expr $CURRENTRX + 524288) \/ 1048576) MB"
	 MONTHTX="`cat /var/local/sns/tx_bytes_month`"
	 MONTHTX="$(expr $(expr $MONTHTX + 524288) \/ 1048576 + $(expr $CURRENTTX + 524288) \/ 1048576) MB"
	fi
	if [ "`lsmod | grep ip_tables`" ]; then
	 FWSTATUS="$(gettext 'On (ip_tables detected)')"
	else
	 FWSTATUS="$(gettext 'Off (ip_tables not detected)')"
	fi
	if [ "$QUERY" = "true" ]; then
	 if [ "`wget -T 15 -O - -q icanhazip.com`" ]; then
	  NETSTATUS="$(gettext 'Connected')"
	 else
	  NETSTATUS="$(gettext 'Disconnected')"
	 fi
	fi
	echo -e "$(gettext 'Firewall:') $FWSTATUS" > /tmp/sysinfo-network
	echo -e "$(gettext 'Network Status:') $NETSTATUS $IFACE" >> /tmp/sysinfo-network
	if [ "`iwgetid | awk '{print $2}'`" ]; then
	 ESSID="`iwgetid | cut -d ":" -f 2- | sed 's/\"//g'`"
	 IWSPECS="`iwconfig | grep -E 'Bit|Link' | tr -s ' ' | sed -e 's/^[ \t]*//' -e 's/ level//g'`"
	 echo "$(gettext 'Wireless Network:') $ESSID" >> /tmp/sysinfo-network
	 echo "$IWSPECS" >> /tmp/sysinfo-network
	else
	 echo "$(gettext 'Wireless Network: No wireless connection')" >> /tmp/sysinfo-network
	fi
	if [ "$IFACE" ]; then
	 HWADDRESS="`ifconfig | grep -A7 $IFACE | grep -i 'HWaddr' | awk '{ print $NF }'`"
	 NETADDRESS="`ifconfig | grep -A7 $IFACE | grep 'inet addr' | cut -d ":" -f2 | cut -d " " -f1`"
	 echo -e "$(gettext 'Session Data:') $(gettext 'Received') $SESSIONRX, $(gettext 'Sent') $SESSIONTX" | sed -e 's/(//g' -e 's/)//g' >> /tmp/sysinfo-network
	 if [ "`cat /var/local/sns/rx_bytes_month`" ]; then
	  echo -e "$(gettext 'Monthly Data:') $(gettext 'Received') $MONTHRX, $(gettext 'Sent') $MONTHTX" >> /tmp/sysinfo-network
	 fi
	 echo -e "\n$(gettext 'Hostname:') $(hostname)" >> /tmp/sysinfo-network
	 if [ "$QUERY" = "true" ]; then
	  echo -e "$(gettext 'External IP Address:') `wget -O - -q icanhazip.com`" >> /tmp/sysinfo-network
	 fi
	 echo -e "$(gettext 'Network IP Address:') $NETADDRESS" >> /tmp/sysinfo-network
	 echo -e "$(gettext 'Domain Name Server (DNS):')`grep nameserver /etc/resolv.conf | sed 's/nameserver//g'`" >> /tmp/sysinfo-network
	 echo -e "$(gettext 'Hardware Address (MAC):') $HWADDRESS" >> /tmp/sysinfo-network
	fi
	kill $X4PID
	;;

-sysinfo_optical)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X10PID=$!
	rm -f /tmp/sysinfo-optical 2>/dev/null
	for OPT in sr0 sr1 sr2 sr3
	do
	 if [ "`hdparm -I /dev/"$OPT" | grep 'CD-ROM'`" ]; then
	 echo -e "\nCD/DVD: "$OPT"\n===========" >> /tmp/sysinfo-optical
	 echo -e "`hdparm -I /dev/"$OPT" 2>/dev/null`" >> /tmp/sysinfo-optical && echo -e "Read/Write speed:\n`cdrecord -prcap dev=/dev/"$OPT" 2>/dev/null | grep -Ei 'Maximum read|Maximum write' | sed 's/  Maximum/	Maximum/g'`" >> /tmp/sysinfo-optical
	 fi
	done
	if [ ! "`cat /tmp/sysinfo-optical`" ]; then
	 hdparm -I /dev/cdrom 2>/dev/null > /tmp/sysinfo-optical
	 hdparm -I /dev/dvd 2>/dev/null >> /tmp/sysinfo-optical
	fi
	if [ ! "`cat /tmp/sysinfo-optical`" ]; then
	 echo -e "\n$(gettext 'No CD/DVD Drive detected.')" > /tmp/sysinfo-optical
	fi	 
	kill $X10PID
	;;

-sysinfo_packages)
	echo -e "▶—— /var/log/packages ——◀\n" > /tmp/pup-sysinfo.txt
	if [ "`ls /var/log/packages`" ]; then
	 ls /var/log/packages | sort | uniq >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No packages are detected.')" >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_partitions)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X5PID=$!
	rm -f /tmp/sysinfo-partitions 2>/dev/null
	if [ "`df -h | grep -E 'sd[a-z]|hd[a-z]|sr[0-9]|cdrom|dvd'`" ]; then
	 echo -e "▶ $(gettext 'Active/Mounted Partitions') (df -h):\n" >> /tmp/sysinfo-partitions
	 df -h | (read -r; printf "%s\n" "$REPLY"; sort $VER) | grep -E 'Filesystem|sd[a-z]|hd[a-z]|sr[0-9]|cdrom|dvd' | sed -e 's/          //g' -e 's/^/ /' >> /tmp/sysinfo-partitions
	 echo >> /tmp/sysinfo-partitions
	fi
	if [ "`probepart -m`" ]; then
	 echo -e "▶ $(gettext 'All Partitions') (probepart):\n" >> /tmp/sysinfo-partitions
	 echo -e " Part    Type    Size(MB)" >> /tmp/sysinfo-partitions
	 echo -e " ====    ====    ====" >> /tmp/sysinfo-partitions
	 probepart -m | grep -Ev 'none' | sed -e 's/\/dev\// /g' -e 's/|/	 /g' | sort $VER >> /tmp/sysinfo-partitions
	 echo >> /tmp/sysinfo-partitions
	fi
	if [ "`grep -R 'Summary' $HOME/.pup_event`" ]; then
	 echo -e "▶ $(gettext 'All Partitions') ($HOME/.pup_event):\n" >> /tmp/sysinfo-partitions
	 parted --list | grep -E '^Model:|^Disk' | grep -v Flags | sed -e\ 's%^Model: %%g' -e 's%^Disk \/dev\/%%g' -e 's%(scsi)%%g' -e 's%^% %' | sed 'N; s/\n/–/' >> /tmp/sysinfo-partitions
	 echo -e "\n Part    Type    Size" >> /tmp/sysinfo-partitions
	 echo -e " ====    ====    ====" >> /tmp/sysinfo-partitions
	 if [ "$DISTRO_NAME" = "Lighthouse64" ]; then
	  grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Filesystem: | cut -d ">" -f2 | sed -e 's% Filesystem:%	%g' -e 's% Size:%	%g' -e 's%<\/Summary%%g' -e 's%^% %g' >> /tmp/sysinfo-partitions
	 else
	  grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Filesystem: | sed -e 's%\/root\/.pup_event\/drive_%%g' -e 's%\/AppInfo.xml:%%g' -e 's%  <Summary>Filesystem:%	%g' -e 's% Size:%	%g' -e 's%<\/Summary>%%g' -e 's%^% %g' -e 's% Size:%	Size:%g' >> /tmp/sysinfo-partitions
	 fi
	 echo >> /tmp/sysinfo-partitions
	fi
	if [ "`blkid | grep -E 'sd[a-z]|sr[0-9]'`" ]; then
	 echo -e "▶ $(gettext 'Partition Attributes') (blkid):\n" >> /tmp/sysinfo-partitions
	 blkid | grep -E 'sd[a-z]|sr[0-9]' | sed -e 's/\/dev\// /g' -e 's/: /:	/g' | sort $VER >> /tmp/sysinfo-partitions
	 echo >> /tmp/sysinfo-partitions
	fi
	if [ "`parted --list 2>/dev/null | grep 'Model'`" ]; then
	 echo -e "▶ $(gettext 'Partition Specifications') (parted):\n" >> /tmp/sysinfo-partitions
	 parted --list | sed '$d' | grep -v 'Partition Table' | sed -e 's/^/ /' -e 's/ Model:/•Model:/g' -e 's/^ Number/ Part: /g' -e 's/File system/File-system/g' >> /tmp/sysinfo-partitions
	fi
	echo -e "▶ $(gettext 'Partition Tables') (fdisk 1):" >> /tmp/sysinfo-partitions
	fdisk -l 2>/dev/null | grep -Ev '^Partition|phys=' | sed -e 's/^/ /' -e 's/ Disk \//•Disk \//' >> /tmp/sysinfo-partitions
	if [ ! "`cat /tmp/sysinfo-partitions`" ]; then
	 echo -e "$(gettext 'No drive partitions detected.')" > /tmp/sysinfo-partitions
	fi
	kill $X5PID
	;;

-sysinfo_pci)
	echo -e "▶—— $(gettext 'DEVICES: PCI INTERFACES') ——◀\n" > /tmp/sysinfo-pci
	if [ "`lspci -knn`" ]; then
	 lspci -knn | grep -iv Subsystem: | 
	 sed -e '/:[0-9a-z][0-9a-z]./{x;p;x;}' -e 's/driver in use: /• Kernel Driver=/g' -e 's/modules: /• Kernel Module=/g' | cut -d " " -f2- | 
	 sed -e '/./,/^$/!d' -e 's/]: /]: \n• /g' -e 's/ \[/\n [/g' | grep -v ']: ' | 
	 sed -e '/ \[/ s/ \[/• VendorID=/g' -e '/VendorID/ s/:/  DeviceID=/' -e '/DeviceID/ s/rev / Rev=/' | tr -d '[]()' >> /tmp/sysinfo-pci
	elif [ "`lspci -nn`" ]; then
	 lspci -nn | cut -c9- >> /tmp/sysinfo-pci
	else
	 echo "$(gettext 'No PCI devices detected.')" >> /tmp/sysinfo-pci
	fi
	;;

-sysinfo_pets)
	cut -d "|" -f 1,10 /root/.packages/user-installed-packages > /tmp/installedpkgs.results
	if [ "`cat /tmp/installedpkgs.results`" ]; then
	 echo -e "▶—— /root/.packages/user-installed-packages ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /tmp/installedpkgs.results >> /tmp/pup-sysinfo.txt
	elif [ "`cat /root/.packages/alienpackages.txt`" ]; then
	 echo -e "▶—— /root/.packages/alienpackages.txt ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /root/.packages/alienpackages.txt | cut -d " " -f1 | sed 's/\"//g' | sort >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No user-installed PET packages are detected.')" > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_pinboard)
	if [ "`cat /root/Choices/ROX-Filer/PuppyPin`" ]; then
	 echo -e "▶—— /root/Choices/ROX-Filer/PuppyPin ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /root/Choices/ROX-Filer/PuppyPin >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'PuppyPin is not detected in') /root/Choices/ROX-Filer/PuppyPin. " > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_printers)
	echo "`grep '<DefaultPrinter ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" > /tmp/sysinfo-printers
	echo "`grep '<Printer ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" >> /tmp/sysinfo-printers
	if [ "`cat /tmp/sysinfo-printers`" ]; then
	 echo -e "▶—— $(gettext 'Printers') ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /tmp/sysinfo-printers | sed '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No printers are detected in') /etc/cups/printers.conf." > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_private)
	sed -i -e 's/▶——/====>/g' -e 's/——◀/<====/g' -e 's/▶/=>/g' -e 's/▸/=>/g' -e 's/•/+/g' -e 's/—/-/g' -e 's/–/-/g' /tmp/pup-sysinfo.txt
	PRIVATE=`cat $PREFDIR/psi_private 2>/dev/null`
	[ "$PRIVATE" = "true" ] && grep -Ev 'Hostname:|Monthly Data:|Session Data:|Domain Name Server|External IP Address:|Hardware Address|Network IP Address:|Part Number:|SerialNumber|Serial Number|Username:|UUID:|Wireless Network:|Asset Tag:' /tmp/pup-sysinfo.txt > /tmp/tmp && mv -f /tmp/tmp /tmp/pup-sysinfo.txt
	defaulttexteditor /tmp/pup-sysinfo.txt &
	;;

-sysinfo_pupkview)
	sleep .3
	$WORKDIR/Pup-Kview &
	;;

-sysinfo_pupsaves)
	if [ "`cat /initrd/tmp/PUPSAVES-complete`" ]; then
	 echo -e "▶—— /initrd/tmp/PUPSAVES-complete ——◀\n" > /tmp/pup-sysinfo.txt
	 cat /initrd/tmp/PUPSAVES-complete >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No PupSave files are detected in') /initrd/tmp/PUPSAVES-complete." > /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_pupsysinfo)
	LANG=$DEF_LANG
	sleep .3
	. $WORKDIR/Pup-SysInfo &
	;;

-sysinfo_raid)
	if [ "`grep ^md /proc/mdstat 2>/dev/null`" ]; then
	 cat /proc/mdstat >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No active RAID drives are detected') in /proc/mdstat." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_samba) #TaZoC sysinfo
	if [ "`which smbclient`" ]; then
	echo -e "▶—— $(gettext 'Samba Network Sharing') ——◀\n" > /tmp/sysinfo-samba
	echo -e "smbclient `smbclient -V`  $([ `which smbd` ] && echo smbd `smbd -V`)" >> /tmp/sysinfo-samba
	[ "`which nmblookup`" ] && echo -e "nmblookup `nmblookup -V`  " >> /tmp/sysinfo-samba
	[ "`which nmbd`" ] && echo -en "nmbd `nmbd -V`  " >> /tmp/sysinfo-samba
	[ "`which winbindd`" ] && echo -en "winbindd `winbindd -V`  " >> /tmp/sysinfo-samba
	[ "`which testparm`" ] && echo -e "\n\n▸testparm -s\n\n`testparm -s 2>/dev/null`  " >> /tmp/sysinfo-samba
	fi
	;;

-sysinfo_scsi)
	echo -e "\n▶—— $(gettext 'DEVICES: SCSI') ——◀\n" > /tmp/sysinfo-scsi
	if [ "`cat /proc/scsi/scsi 2>/dev/null`" ]; then
	 grep -E 'Host:|Vendor:|Type:' /proc/scsi/scsi | tr -s ' ' | sed \
	 -e 's/^[ \t]*//' \
	 -e '/^Type/G' \
	 -e s'/ ANSI SCSI revision: [0-9][0-9]//g' \
	 -e s'/Model:/\nModel:/g' \
	 -e s'/ Rev:/, Rev:/g' \
	 -e s'/- //g' \
	 -e s'/: /=/g' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' >> /tmp/sysinfo-scsi
	 cat /tmp/sysinfo-scsi >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No SCSI devices are detected in') /proc/scsi/scsi." >> /tmp/sysinfo-scsi
	fi
	;;

-sysinfo_scsiStorage)
	echo -e "▶—— $(gettext 'SCSI DRIVES') ——◀\n" > /tmp/pup-sysinfo.txt
	if [ "`probedisk 2>/dev/null`" ]; then
	 echo -e "▶ probedisk\n" >> /tmp/pup-sysinfo.txt
	 probedisk | tr -s ' ' | sed -e 's%\/dev\/% %g' -e 's%|%	%g' -e s'%Direct-Access%drive%g' -e s'%optical%cd\/dvd%g' >> /tmp/pup-sysinfo.txt
	 echo >> /tmp/pup-sysinfo.txt
	fi
	if [ "`cat /proc/scsi/scsi 2>/dev/null`" ]; then
	 echo -e "▶ /proc/scsi/scsi\n" >> /tmp/pup-sysinfo.txt
	 xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	 XPID=$!
	 grep -E 'Host:|Vendor:|Type:' /proc/scsi/scsi | tr -s ' ' | sed \
	 -e 's/^[ \t]*//' \
	 -e '/^Type/G' \
	 -e s'/ ANSI SCSI revision: [0-9][0-9]//g' \
	 -e s'/Model:/\n Model:/g' \
	 -e s'/ Rev:/, Rev:/g' \
	 -e s'/- //g' \
	 -e s'/: /=/g' \
	 -e s'/^/ /g' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' >> /tmp/pup-sysinfo.txt
	 echo -e "\n▶ parted $(gettext '(drive capacity)')\n" >> /tmp/pup-sysinfo.txt
	 parted --list | grep -E '^Model:|^Disk' | grep -v Flags | sed \
	 -e 's%^Model: %%g' \
	 -e 's%^Disk \/dev\/%%g' \
	 -e 's%(scsi)%%g' \
	 -e 's%^% %' | sed 'N; s/\n/–/' >> /tmp/pup-sysinfo.txt
	 kill $XPID
	else
	 echo "$(gettext 'No SCSI devices are detected in') /proc/scsi/scsi." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_sensors)
	if [ ! "`lsmod | grep -E -q 'coretemp|it87|k*temp'`" ]; then
	 modprobe it87 2>/dev/null
	 if [ "`grep '^model name' /proc/cpuinfo | grep Intel`" ]; then
	  modprobe coretemp 2>/dev/null
	 elif [ "`grep '^model name' /proc/cpuinfo | grep AMD`" ]; then
	  for m in k8temp k10temp
	   do modprobe $m 2>/dev/null
	  done
	 fi
	fi
	KV=`uname -r`
	[ "${KV:2:1}" -lt 7 ] && HorT=head || HorT=tail # 01micko test for kernels >=3.7
	THRMFILES=$(find /sys/devices/ -name temp*_input 2>/dev/null | cut -d'_' -f1 | sort)
	echo "$THRMFILES" > /tmp/tmp
	echo -n > /tmp/tmp1
	echo -n > /tmp/tmp2
	while read -r line
	 do
	  THRMDIR=$(dirname "$line")
	  THRMNAME=$(cat $THRMDIR/name 2>/dev/null) || THRMNAME=""
	  CRIT=$(${HorT} -n1 "$line"_crit 2>/dev/null)
	  [ "$CRIT" ] && THRMCRIT="$(expr $CRIT / 1000)" || THRMCRIT="NA"
	  INPUT=$(${HorT} -n1 "$line"_input 2>/dev/null)
	  [ "$INPUT" ] && echo "$INPUT" >> /tmp/tmp2 && THRMINPUT="$(expr $INPUT / 1000)" || THRMINPUT="NA"
	  THRMLABEL=$(${HorT} -n1 "$line"_label 2>/dev/null | sed 's/Physical id/Phys/')
	  [[ ! $(echo "$THRMLABEL" | grep -E '^Phys|^Core' 2>/dev/null) ]] && THRMLABEL=$(basename "$line" | cut -d'_' -f1)
	  [ ! "$THRMLABEL" ] && THRMLABEL="Core 0"
	  MAX=$(${HorT} -n1 "$line"_max 2>/dev/null)
	  [ "$MAX" ] && THRMMAX="$(expr $MAX / 1000)" || THRMMAX="NA"
	  [[ ! $(echo "$THRMINPUT" | grep '^-') ]] && echo "$(gettext "$THRMLABEL") ($THRMNAME) : +$THRMINPUT.0 C ($(gettext 'high') = +$THRMMAX.0 C, $(gettext 'crit') = +$THRMCRIT.0 C)" >> /tmp/tmp1
	 done < /tmp/tmp
	SENSORS=$(which sensors 2>/dev/null)
	THRMCHECK=$(grep '[1-9]' /tmp/tmp2 2>/dev/null)
	[ "$THRMCHECK" ] && THRM=$(cat /tmp/tmp1 2>/dev/null)
	[ ! "$THRMCHECK" ] && THRM=$(find /sys/bus/acpi/devices/ -name temp | ${HorT} -n1 2>/dev/null) && THRMCHECK=$(echo "$THRM" | grep '[1-9]' 2>/dev/null)
	if [ "$THRMCHECK" ]; then
	 echo "${THRM}" > /tmp/sysinfo-sensors
	elif [ "$SENSORS" ]; then #sensors utility installed
	 if [ -f /etc/sensors3.conf.new ]; then
	  S3CONF=$(sensors -A -c /etc/sensors3.conf.new)
	 else
	  S3CONF=$(sensors -A -c /etc/sensors3.conf)
	 fi
	 echo "$S3CONF" 2>/dev/null | tr -s ' ' > /tmp/sysinfo-sensors.conf
	 if [ "`cat /tmp/sysinfo-sensors.conf 2>/dev/null`" ]; then
	  cat /tmp/sysinfo-sensors.conf | sed 's/[°]/ /g' > /tmp/sysinfo-sensors
	 else
	  echo "$(gettext 'Sensor status is not available, or local hardware is not supported.') " > /tmp/sysinfo-sensors
	 fi
	else
	 echo "$(gettext 'Sensor status is not available, or required kernel drivers are not loaded.') " > /tmp/sysinfo-sensors
	fi
	;;

-sysinfo_startup)
	echo -e "▶—— $HOME/.config/autostart/ ——◀\n" > /tmp/pup-sysinfo.txt
	if [ "`ls $HOME/.config/autostart | grep .desktop 2>/dev/null`" ]; then
	 ls $HOME/.config/autostart | grep .desktop | grep -v desktop.bak | sort -fu | sed -e 's/.desktop//' -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No startup files are detected in') $HOME/.config/autostart." >> /tmp/pup-sysinfo.txt	
	fi
	echo -e "\n▶—— $HOME/Startup/ ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`find -L $HOME/Startup -perm -111 -type f -maxdepth 1 2>/dev/null`" ]; then
	 find -L $HOME/Startup -perm -111 -type f -maxdepth 1 | awk -F'/' '{print $NF}' | sort -fu | sed -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No startup files are detected in') $HOME/Startup." >> /tmp/pup-sysinfo.txt	
	fi
	echo -e "\n▶—— /etc/init.d/ ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`find -L /etc/init.d -perm -111 -type f -maxdepth 1 2>/dev/null`" ]; then
	 find -L /etc/init.d -perm -111 -type f -maxdepth 1 | awk -F'/' '{print $NF}' | sort -fu | sed -e '/^$/d' >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No startup files are detected in') /etc/init.d." >> /tmp/pup-sysinfo.txt	
	fi
	;;

-sysinfo_storage)
	#code adapted from BK's resizepfile.sh...
	. /etc/rc.d/PUPSTATE
	CURRMODE="`echo -n "$PUPMODE" | cut -f 2 -d '='`"
	if [ $CURRMODE = "12" ]; then
	 PERSISTMNTPT="/initrd/pup_rw"
	elif [ $CURRMODE = "13" ]; then
	 PERSISTMNTPT="/initrd/pup_ro1"
	else
	 PERSISTMNTPT=""
	fi
	SAVEFILE="`echo -n "$PUPSAVE" | cut -f 3 -d ','`"
	SAVEPART="`echo -n "$PUPSAVE" | cut -f 1 -d ','`"
	BOOTPART="`echo -n "$PDEV1" | cut -f 2 -d '='`"
	BOOTFS="`echo -n "$DEV1FS" | cut -f 2 -d '='`"
	BOOTMEDIA="`echo -n "$PMEDIA" | cut -f 2 -d '='`"
	NAMEPFILE="`basename $SAVEFILE`"
	HOMELOCATION="/initrd${PUP_HOME}${SAVEFILE}"
	if [ -d $HOMELOCATION ]; then
	 ACTUALSIZE=`df -m | grep "$PERSISTMNTPT" | tr -s " " | cut -f 2 -d " "` #total size of pup_save folder
	else
	 ACTUALSIZK=`ls -sk $HOMELOCATION | tr -s " " | cut -f 1 -d " "` #total size of pup_save file
	 if [ ! $ACTUALSIZK ] 2>/dev/null; then
	  ACTUALSIZK=`ls -sk $HOMELOCATION | tr -s " " | cut -f 2 -d " "`
	 fi
	 ACTUALSIZE=`expr $ACTUALSIZK \/ 1024 2>/dev/null`
	fi
	SIZEFREE=`df -m | grep "$PERSISTMNTPT" | tr -s " " | cut -f 4 -d " "` #free space in pup_save
	MEMTOTAL=`grep MemTotal /proc/meminfo | awk '{print $2}'`
	MEMTOTAL=`expr $MEMTOTAL \/ 1024`
	MEMFREE=`grep MemFree /proc/meminfo | awk '{print $2}'`
	MEMFREE=`expr $MEMFREE \/ 1024`
	MEMUSED=`expr $MEMTOTAL \- $MEMFREE`
	BUFFERS=`grep Buffers /proc/meminfo | awk '{print $2}'`
	BUFFERS=`expr $BUFFERS \/ 1024`
	SWAPTOTAL=`grep SwapTotal /proc/meminfo | awk '{print $2}'`
	SWAPTOTAL=`expr $SWAPTOTAL \/ 1024`
	SWAPFREE=`grep SwapFree /proc/meminfo | awk '{print $2}'`
	SWAPFREE=`expr $SWAPFREE \/ 1024`
	;;

-sysinfo_summary)
	. /etc/DISTRO_SPECS
	. $WORKDIR/func -sysinfo_pci
	. $WORKDIR/func -sysinfo_storage
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	echo -e "$(gettext 'Pup-SysInfo Hardware Report (Summary),') `date +'%a %-e %b %Y'`" > /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_uptime
	echo -e "\n▶—— $(gettext 'BASE SYSTEM') ——◀\n" >> /tmp/pup-sysinfo.txt
	dmidecode -t 1 | grep -E 'Manufacturer:|Product Name:' | sed -e 's/Manufacturer:/PC Manufacturer:/g' -e 's/	//g' >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	dmidecode -t 2 | grep -E 'Manufacturer:|Product Name' | sed -e 's/Manufacturer:/Motherboard Vendor:/g' -e 's/	//g' >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	dmidecode -t 0 | grep -E 'Vendor:|Version:|Release Date:' | sed -e 's/Vendor:/BIOS Vendor:/' -e 's/	//g' >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_cpu
	cat /tmp/sysinfo-cpu | grep -Ev 'Socket|Manufacturer|Voltage|External|capable' >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_sensors
	cat /tmp/sysinfo-sensors >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_memory
	cat /tmp/sysinfo-memory | grep -v 'MEMORY' >> /tmp/pup-sysinfo.txt
	echo -e "\n$(gettext 'Linux Kernel:') `uname -r` (`uname -m`)" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Kernel Version:') `uname -v`" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_kernelpae
	. $WORKDIR/func -sysinfo_distro
	echo -e "\n$(gettext 'Username:') "`whoami`"" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_country
	. $WORKDIR/func -sysinfo_netsummary
	echo >> /tmp/pup-sysinfo.txt
	cat /tmp/sysinfo-network >> /tmp/pup-sysinfo.txt
	SAVESIZE=`df -h | grep dev_save | awk '{print $2}'`
	SAVEFREE=`df -h | grep dev_save | awk '{print $4}'`
	[ "$SAVESIZE" ] && SAVESIZEFREE="(Size $SAVESIZE, Free $SAVEFREE)"
	[ "$PUPMODE" = "12" -o "$PUPMODE" = "13" ] && SAVEPARTSPACE="$SAVESIZEFREE"
	echo >> /tmp/pup-sysinfo.txt
	[ "$SAVESIZE" ] && echo -e "$(gettext 'Boot Partition:') $BOOTPART $SAVEPARTSPACE" >> /tmp/pup-sysinfo.txt
	[ "$DEV1FS" ] && echo -e "$(gettext 'Boot File System:') $BOOTFS" >> /tmp/pup-sysinfo.txt
	[ "$PMEDIA" ] && echo -e "$(gettext 'Boot Media:') $BOOTMEDIA" >> /tmp/pup-sysinfo.txt
	echo >> /tmp/pup-sysinfo.txt
	grep -E '^PUPMODE|^PUPSFS|^PUPSAVE' /etc/rc.d/PUPSTATE | sed s/\'//g >> /tmp/pup-sysinfo.txt
	if [ "$sysBAT" -o "$procBAT" ]; then
	 . $WORKDIR/func -sysinfo_bat0
	 cat /tmp/sysinfo-battery 2>/dev/null | sed -e 's/▶—— DEVICES: NOTEBOOK /\n▶—— /' -e '${/^$/d}' >> /tmp/pup-sysinfo.txt
	 [ "$BATTERY1" ] && . $WORKDIR/func -sysinfo_bat1
	 [ "$BATTERY1" ] && cat /tmp/sysinfo-battery 2>/dev/null | sed -e 's/▶—— DEVICES: NOTEBOOK /\n▶—— /' -e '${/^$/d}' >> /tmp/pup-sysinfo.txt
	fi
	echo -e "\n▶—— $(gettext 'DISPLAY') ——◀\n" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Display Specifications:')" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_videosummary
	echo -e "\n▶—— $(gettext 'MULTIMEDIA') ——◀\n" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_audio
	cat /tmp/sysinfo-audio >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'NETWORK') ——◀" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_netdevices
	cat /tmp/sysinfo-netdevices >> /tmp/pup-sysinfo.txt
	echo -e "\n▶—— $(gettext 'INPUT DEVICES') ——◀\n" >> /tmp/pup-sysinfo.txt
	grep '^N:' /proc/bus/input/devices | sed -e 's/N: Name=//g' -e 's/[©®–"]//g' | sort -fu >> /tmp/pup-sysinfo.txt
	echo -e "\n`cat /tmp/sysinfo-pci | sed -e 's/DEVICES: PCI INTERFACES/PCI DEVICES/'`" >> /tmp/pup-sysinfo.txt
	echo "`grep '<DefaultPrinter ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" > /tmp/sysinfo-printers
	echo "`grep '<Printer ' /etc/cups/printers.conf | tr -d '<' | tr -d '>'`" >> /tmp/sysinfo-printers
	echo -e "\n▶—— $(gettext 'PRINTERS') ——◀\n" >> /tmp/pup-sysinfo.txt
	if [ "`cat /tmp/sysinfo-printers`" ]; then
	 cat /tmp/sysinfo-printers | sed '/^$/d' >> /tmp/pup-sysinfo.txt
	 echo >> /tmp/pup-sysinfo.txt
	else
	 echo -e " $(gettext 'No printers are detected in') /etc/cups/printers.conf. \n" >> /tmp/pup-sysinfo.txt
	fi
	if [ -f /proc/scsi/scsi ]; then
	 echo -e "▶—— $(gettext 'SCSI DEVICES') ——◀\n" > /tmp/sysinfo-scsi
	 cat /proc/scsi/scsi | grep 'Vendor:' | tr -s ' ' | sed -e 's/^[ \t]*//' -e 's/Vendor: //g' -e 's/ Model://g' >> /tmp/sysinfo-scsi
	 cat /tmp/sysinfo-scsi >> /tmp/pup-sysinfo.txt
	fi
	if [ "`grep -R 'Summary' $HOME/.pup_event`" ]; then
	 echo -e "\n▶—— $(gettext 'SCSI PARTITIONS') ——◀\n" >> /tmp/pup-sysinfo.txt
	 parted --list | grep -E '^Model:|^Disk' | grep -v Flags | sed -e\ 's%^Model: %%g' -e 's%^Disk \/dev\/%%g' -e 's%(scsi)%%g' | sed 'N; s/\n/– /' >> /tmp/pup-sysinfo.txt
	 echo >> /tmp/pup-sysinfo.txt
	 if [ "$DISTRO_NAME" = "Lighthouse64" ]; then
	  grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Filesystem: | cut -d ">" -f2 | sed -e 's% Filesystem:%	%g' -e 's% Size:%	%g' -e 's%<\/Summary%%g' >> /tmp/pup-sysinfo.txt
	 else
	  grep -R 'Summary' $HOME/.pup_event | sort $VER | grep Filesystem: | sed -e 's%\/root\/.pup_event\/drive_%%g' -e 's%\/AppInfo.xml:%%g' -e 's%  <Summary>Filesystem:%	%g' -e 's%<\/Summary>%%g' -e 's% Size:%	%g' >> /tmp/pup-sysinfo.txt
	 fi
	fi
	if [ "`df -h | grep -E 'sd[a-z]|hd[a-z]|sr[0-9]|cdrom|dvd'`" ]; then
	 echo -e "\n▶—— $(gettext 'SCSI PARTITIONS MOUNTED') ——◀\n" >> /tmp/pup-sysinfo.txt
	 df -h | (read -r; printf "%s\n" "$REPLY"; sort $VER) | grep -E 'Filesystem|sd[a-z]|hd[a-z]|sr[0-9]|cdrom|dvd' | sed -e 's/          //g' >> /tmp/pup-sysinfo.txt
	fi
	echo >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_usb
	if [ "`lsusb`" ] && [ "`which usb-devices`" -o -f /proc/bus/usb/devices ]; then
	 echo -e "\n--\n" >> /tmp/sysinfo-usb
	 lsusb >> /tmp/sysinfo-usb
	fi
	cat /tmp/sysinfo-usb | grep -v '^Serial' | sed '/^$/N;/\n$/D' >> /tmp/pup-sysinfo.txt
	echo -e "\n=== $(gettext 'END OF SUMMARY REPORT') ===\n" >> /tmp/pup-sysinfo.txt
	SYSDATE="`date +'%y%m%d'`"
	PRIVATE=`cat $PREFDIR/psi_private 2>/dev/null`
	echo -e "$(gettext 'This report is also available in')\n/tmp/${USER}/PSI-HW-SUMMARY-$SYSDATE." >> /tmp/pup-sysinfo.txt
	[ "$PRIVATE" = "true" ] && grep -Ev 'Hostname:|Monthly Data:|Session Data:|Domain Name Server|External IP Address:|Hardware Address|Network IP Address:|Part Number:|SerialNumber|Serial Number|Username:|UUID:|Wireless Network:|Asset Tag:' /tmp/pup-sysinfo.txt > /tmp/tmp && mv -f /tmp/tmp /tmp/pup-sysinfo.txt
	mkdir -p /tmp/${USER}/
	cat /tmp/pup-sysinfo.txt > /tmp/${USER}/PSI-HW-SUMMARY-$SYSDATE
	cat /tmp/pup-sysinfo.txt | gzip -f > /tmp/${USER}/PSI-HW-SUMMARY-$SYSDATE.gz
	kill $XPID
	;;

-sysinfo_top) rxvt -sr -bg "#eeeeee" -fg black -fn xft:mono:pixelsize=14:autohint=true -T "System Processes" -n Top -e top -d 03 ;;

-sysinfo_uptime)
	echo -e "\n`date '+Current Time: %H:%M:%S'`" >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'System Uptime:') `uptime | sed -e 's/[0-9] users,//' -e 's/[0-9] user,//' | tr -s ' ' | grep -e '\up.*\, load' | sed -e 's/.*\up\(.*\)\, load.*/\1/' -e 's/ min//' -e 's/:/ hr /'` min" | tr -s ' ' >> /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Load Average:') `cat /proc/loadavg | cut -d " " -f1-3`" >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_usb)
	echo -e "▶—— $(gettext 'USB DEVICES') ——◀\n" > /tmp/sysinfo-usb
	if [ "`which usb-devices`" ]; then
	 usb-devices | grep -Ev 'T:|B:|D:|C:|A:|E:' | sed -e 's/P:  //g' -e 's/S:  //g' -e 's/Vendor/VendorID/g' -e 's/ProdID/ProductID/g' -e 's/Driver=/\nDriver=/g' -e 's/[©®–]//g' | sed '/./,/^$/!d' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | grep -Ev 'I:|(none)' | uniq >> /tmp/sysinfo-usb
	elif [ -f /proc/bus/usb/devices ]; then
	 grep -Ev 'T:|B:|D:|C:|A:|E:' /proc/bus/usb/devices | sed -e 's/P:  //g' -e 's/S:  //g' -e 's/Vendor/VendorID/g' -e 's/ProdID/ProductID/g' -e 's/Driver=/\nDriver=/g' -e 's/[©®–]//g' | sed '/./,/^$/!d' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | grep -Ev 'I:|(none)' | uniq >> /tmp/sysinfo-usb
	elif [ "`which lsusb`" ]; then
	  lsusb >> /tmp/sysinfo-usb
	fi
	;;

-sysinfo_usbcomplete)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	XPID=$!
	echo -e "▶—— $(gettext 'USB DEVICES') (lsusb) ——◀\n" > /tmp/sysinfo-usbcomplete
	echo -e "`lsusb | sed -e 's/[©®–]//g'`" >> /tmp/sysinfo-usbcomplete
	if [ "`lsusb -t | grep Driver 2>/dev/null`" ]; then
	 echo -e "\n\n▶—— $(gettext 'USB DEVICES') (lsusb -t) ——◀\n" >> /tmp/sysinfo-usbcomplete
	 lsusb -t | cut -c5- | sed -e 's/Dev /Device /g' -e 's/If /Interface /g' -e '/M$/s/$/bit\/s/' >> /tmp/sysinfo-usbcomplete
	 echo >> /tmp/sysinfo-usbcomplete
	fi
	echo -e "\n▶—— $(gettext 'USB DEVICES') (lsusb -v) ——◀\n" >> /tmp/sysinfo-usbcomplete
	USBDEVICES=`lsusb | awk '{print $2, $3, $4}' | cut -d ':' -f1 | sed 's/ Device /:/g'`
	for DEVICE in $USBDEVICES
	do
	  lsusb -vs $DEVICE | grep -E '^Bus|bcdUSB|iManufacturer|iProduct|iSerial|MaxPower|bInterfaceClass' | tr -d ©®  | sed \
	  -e 's/ [ ]* / /g' \
	  -e 's/^Bus/  \nBus/g' \
	  -e 's/bcdUSB/USB Version =/g' \
	  -e 's/iManufacturer [1-9]/Manufacturer =/g' \
	  -e 's/iProduct [1-9]/Product =/g' \
	  -e 's/iSerial [1-9]/Serial Number =/g' \
	  -e 's/MaxPower/Max Current =/g' \
	  -e 's/bInterfaceClass [1-9][ ]/Class = /g' \
	  -e 's/bInterfaceClass [0][A-E][ ]/Class = /g' \
	  -e 's/bInterfaceClass [E0][ ]/Class = /g' | grep -Ev '= 0 |^ i|^ b|= 0mA' | sed \
	  -e 's/ID/\n ID =/g' \
	  -e '${/^ USB/d;}' \
	  -e '/^$/d' | uniq >> /tmp/sysinfo-usbcomplete2
	done
	sed -e '1d' /tmp/sysinfo-usbcomplete2 >> /tmp/sysinfo-usbcomplete
	rm -f /tmp/sysinfo-usbcomplete2 2>/dev/null
	kill $XPID
	;;

-sysinfo_usbdrives)
	if [ "`cat /proc/scsi/usb-storage/* 2>/dev/null`" ]; then
	 xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	 XPID=$!
	 USBDRIVES=$(cat /proc/scsi/usb-storage/* | grep Product | sed -e 's/^[ \t]*//' -e 's/^Product: //g')
	 if [ "`which usb-devices`" ]; then
	  echo -e "▶—— $(gettext 'USB DRIVES') (usb-devices) ——◀\n" > /tmp/sysinfo-usbdrives
	  usb-devices | grep -Ev 'T:|B:|D:|C:|A:|I:|E:' | sed -e 's/P:  //g' -e 's/S:  //g' -e 's/Vendor/VendorID/g' -e 's/ProdID/ProductID/g' -e 's/[©®–]//g' | grep -B2 "$USBDRIVES" >> /tmp/sysinfo-usbdrives
	 elif [ -f /proc/bus/usb/devices ]; then
	  echo -e "▶—— $(gettext 'USB DRIVES') (/proc/bus/usb/devices) ——◀\n" > /tmp/sysinfo-usbdrives
	  grep -Ev 'T:|B:|D:|C:|A:|I:|E:' /proc/bus/usb/devices | sed -e 's/P:  //g' -e 's/S:  //g' -e 's/Vendor/VendorID/g' -e 's/ProdID/ProductID/g' -e 's/[©®–]//g' | grep -B2 "$USBDRIVES" >> /tmp/sysinfo-usbdrives
	 else
	  echo -e "▶—— $(gettext 'USB DRIVES') (/proc/scsi/usb-storage) ——◀" > /tmp/sysinfo-usbdrives
	  cat /proc/scsi/usb-storage/* | grep -E 'Host|Vendor|Product' | sed -e 's/^[ \t]*//' -e '/^Host/{x;p;x;}' >> /tmp/sysinfo-usbdrives
	 fi
	 if [ "`which parted`" ]; then
	  echo -e "\n▶—— $(gettext 'USB DRIVES') (parted) ——◀\n" >> /tmp/sysinfo-usbdrives
	  OLDIFS=$IFS
	  IFS=$'\n'
	  for DRIVE in $USBDRIVES
	    do
	     if [ "`parted --list | grep $DRIVE`" ]; then
	      echo -e "`parted --list | grep -A1 "$DRIVE" | sed -e 's/^Disk/Drive:/g'`" >> /tmp/sysinfo-usbdrives2
	     else
	      continue
	     fi
	   done
	  sed 's/^Model:/--\nModel:/' /tmp/sysinfo-usbdrives2 | sed '1d' >> /tmp/sysinfo-usbdrives 
	  rm -f /tmp/sysinfo-usbdrives2 2>/dev/null
	  IFS=$OLDIFS
	 else
	  echo -e "▶—— $(gettext 'USB DRIVES') (parted) ——◀\n" > /tmp/sysinfo-usbdrives
	  echo -e "$(gettext "ERROR: No 'parted' utility for USB drive evaluation.")" >> /tmp/sysinfo-usbdrives
	 fi
	 kill $XPID
	else
	 echo -e "▶—— $(gettext 'USB DRIVES') ——◀\n" > /tmp/sysinfo-usbdrives
	 echo -e "$(gettext 'No USB drives are detected in') /proc/scsi/usb-storage." >> /tmp/sysinfo-usbdrives
	fi
	;;

-sysinfo_variables) env | tail -n 2000 | grep '=' | grep -Ev "^ |--|''|[<>—]|=']|BUTTON[0-9]|TEXT[0-9]|THINGY|INFO=|_=" | sort -u >> /tmp/pup-sysinfo.txt ;;

-sysinfo_video)
	echo -e "▶—— $(gettext 'Video') ——◀\n" > /tmp/pup-sysinfo.txt
	echo -e "$(gettext 'Display Specifications:')" >> /tmp/pup-sysinfo.txt
	. $WORKDIR/func -sysinfo_videosummary
	;;

-sysinfo_videocomplete)
	SCREENSIZE=$(xdpyinfo | grep -E 'dimensions' | sed -e 's/  */\ /g' -e 's/ dimensions/Screen Dimensions/')
	SCREENDEPTH=$(xdpyinfo | grep -E 'depth of' | sed -e 's/  */\ /g' -e 's/ depth of root window/Depth of Root Window/' -e 's/planes/bits (planes)/')
	echo -e "▶—— $(gettext 'Video Hardware Report') ——◀\n" > /tmp/pup-sysinfo.txt # ddcprobe, glxinfo, lspci, modinfo
	echo -e "▶ $(gettext 'VIDEO CARD:')\n" >> /tmp/pup-sysinfo.txt
	echo -e "`lspci -v | sed -n '/VGA/,/^$/p' | sed -r 's/^[^ \t]*[ \t]+//g' | sed -e 's/ compatible//g' -e 's/^Kernel driver in use:/--\nKernel Driver: /' -e 's/devsel/device select/g' -e 's/, IRQ/\nInterrupt Request (IRQ):/g' | grep -v '^Capabilities'`" >> /tmp/pup-sysinfo.txt
	if [ "`lspci -knn`" ]; then
	 rm -f /tmp/sysinfo-video 2>/dev/null
	 VIDEODEVICES=$(lspci -knn | grep -iv Subsystem: | sed -e 's/driver in use/Kernel Driver/g' -e 's/modules/Kernel Module/g' | cut -d " " -f2- | sed '/./,/^$/!d' | grep -A1 'VGA')
	 VIDEODRIVERS=$(echo "$VIDEODEVICES" | grep 'Kernel Driver' | awk -F' ' '{print $NF}')
	 if [ "$VIDEODRIVERS" ]; then
	  for DRIVER in $VIDEODRIVERS
	   do
	     echo "$DRIVER" > /tmp/KMODULE.tmp
	     . $WORKDIR/func -sysinfo_kmodules
	     if [ "`lsmod | grep "$DRIVER"`" ]; then
	      cat /tmp/sysinfo-kernel | grep -E '^Memory|^Path|^Description|^Dependencies|^Used' >> /tmp/sysinfo-video
	     fi
	     echo >> /tmp/sysinfo-video
	   done
	 sed -i '$d' /tmp/sysinfo-video
	 cat /tmp/sysinfo-video >> /tmp/pup-sysinfo.txt
	 fi
	fi
	VESA=`ddcprobe | grep ^vbe: | sed -e 's/vbe/VESA BIOS Extensions/'`
	echo -e "`ddcprobe | sed -e '0,/^edid:/s/^edid:/\nDISPLAY\/MONITOR:\n\nedid:/' -e 's/^oem:/--\nVideo Card OEM:/g' -e 's/^vendor:/Card Vendor:/g' -e 's/^id:/Display ID:/g' -e 's/Display ID:/'"$SCREENDEPTH"'\nDisplay ID:/' -e 's/^Depth/'"$SCREENSIZE"'\nDepth/' -e 's/^eisa/EISA/g' -e 's/^monitorrange/monitorrange (HorizSync \& VertRefresh)/g' | sed 's/^\(.\)/\U\1/' | grep -Ev 'Vbe:|Edid:|Mode:' | sed -e 's/^DISPLAY/▶ DISPLAY/' -e 's/^Memory/'"$VESA"'\nMemory/'`" >> /tmp/pup-sysinfo.txt
	[ "`which glxinfo`" ] && echo -e "--\n`glxinfo | grep -E 'direct rendering:|OpenGL vendor string:|OpenGL renderer string:|OpenGL version string:' | sed -e 's/OpenGL vendor string/OpenGL Vendor/' -e 's/OpenGL renderer string/OpenGL Renderer/' -e 's/OpenGL version string/OpenGL Version/' -e 's/direct rendering/Direct Rendering/'`" >> /tmp/pup-sysinfo.txt
	EDIDFAIL="$(ddcprobe | grep edidfail)"
	if [ "$EDIDFAIL" ]; then
	 echo -e "\n$(gettext 'Processing Error: The ddcprobe utility could not detect the')" >> /tmp/pup-sysinfo.txt
	 echo -e "$(gettext 'Extended Display Identification Data (EDID) of your monitor.')" >> /tmp/pup-sysinfo.txt
	fi
	if [ "`which xdpyinfo`" ]; then
	 echo -e "\n▶ $(gettext 'X-SERVER SCREEN INFORMATION:')\n" >> /tmp/pup-sysinfo.txt
	 xdpyinfo | grep -Ev 'maximum|motion|bitmap|image|keycode|focus|pixmap|bits|colormap|pixels:|options|cursor|mask|Mask|visual|class:|depth:|available colormap|red, green|significant bits|types' | sed -e 's/^\(.\)/\U\1/' -e 's/    /  /g' >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_videosummary)
	rm -f /tmp/sysinfo-video 2>/dev/null
	ddcprobe | grep monitorname: | head -n1 | sed 's/monitorname:/• Monitor Name:/g' >> /tmp/sysinfo-video
	[ "`which xrandr`" ] && echo "• $(gettext 'Monitor VertRefresh:') `xrandr -q | sed -e 's/ [ ]* / /g' | grep '^ [0-9]' | grep '\*' | cut -d ' ' -f3 | cut -d '*' -f1 | head -n1` times/s" | grep -v ' 0.0 times/s' >> /tmp/sysinfo-video
	XSERVER="`readlink /usr/bin/X`"
	if [ "$XSERVER" = "Xorg" ] && [ "`ps -eo comm | grep ^X`" ]; then #based on TazOC code
	 if [ "`which xdpyinfo`" ]; then
	  echo "`xdpyinfo | grep -E 'dimensions|depth of' | sed -e 's/  */\ /g' -e 's/ dimensions/• Screen Dimensions/' -e 's/ depth of root window/• Screen Depth/' -e 's/planes/bits (planes)/'`" >> /tmp/sysinfo-video
	  XORGVERSION=""
	  XORGVERSION=$(echo "• `xdpyinfo | grep version:`")
	 elif [ "`which xrandr`" ]; then
	  xrandr | grep '*' | sed 's/ x /x/g' | cut -d ' ' -f3-6 | sed 's/ /• Screen Dimensions (pixels): /' >> /tmp/sysinfo-video
	 fi
	fi #end
	VIDEODRIVER=""; ALLMODS=""
	if [ "$XSERVER" = "Xorg" ];then #based on BK code
	LOADED="$(grep 'Loading .*/xorg/modules/drivers/.*_drv.so' /var/log/Xorg.0.log | rev | cut -f 1 -d '/' | rev | cut -f 1 -d '_' | tr '\n' ' ')"
	for ALOADED in $LOADED
	do
	  aPTN="UnloadModule: \"$ALOADED\""
	  bPTN="LoadModule: \"$ALOADED\""
	  CNTload=`grep "$bPTN" /var/log/Xorg.0.log | wc -l`
	  CNTunload=`grep "$aPTN" /var/log/Xorg.0.log | wc -l`
	  [ $CNTload -eq 0 ] && continue
	  [ $CNTunload -ge $CNTload ] && continue
	  VIDEODRIVER="$ALOADED"
	  break
	done
	echo -e "\n$(gettext 'Xorg Startup Log') (/var/log/Xorg.0.log):" >> /tmp/sysinfo-video
	[ "$VIDEODRIVER" ] && echo "• $(gettext 'Xorg Driver in use:') ${VIDEODRIVER}" >> /tmp/sysinfo-video
	ALLLOADED="$(grep 'LoadModule: ' /var/log/Xorg.0.log | rev | cut -f 1 -d '/' | rev | cut -f 2 -d '"' | sort -u | tr '\n' ' ')" #'geany
	for ALOADED in $ALLLOADED
	do
	  [ "$ALOADED" = "$VIDEODRIVER" ] && continue
	  aPTN="UnloadModule: \"$ALOADED\""
	  bPTN="LoadModule: \"$ALOADED\""
	  CNTload=`grep "$bPTN" /var/log/Xorg.0.log | wc -l`
	  CNTunload=`grep "$aPTN" /var/log/Xorg.0.log | wc -l`
	  [ $CNTload -eq 0 ] && continue
	  [ $CNTunload -ge $CNTload ] && continue
	  ALLMODS="${ALLMODS} ${ALOADED}"
	done
	echo "• $(gettext 'Loaded Modules:')${ALLMODS}" >> /tmp/sysinfo-video
	fi #end BK code
	[ "$XORGVERSION" ] && echo "$XORGVERSION" >> /tmp/sysinfo-video
	[ "`which glxinfo`" ] && echo -e "\n$(gettext 'OpenGL 2D/3D Rendering:')\n`glxinfo | grep -E 'direct rendering:|OpenGL vendor string:|OpenGL renderer string:|OpenGL version string:' | sed -e 's/OpenGL vendor string/• Vendor/' -e 's/OpenGL renderer string/• Renderer/' -e 's/OpenGL version string/• Version/' -e 's/direct rendering/• Direct Rendering/'`" >> /tmp/sysinfo-video
	echo >> /tmp/sysinfo-video
	if [ "`lspci -knn`" ]; then
	 VIDEODEVICES=$(lspci -knn | grep -iv Subsystem: | sed -e 's/ compatible//g' -e 's/driver in use/• Kernel Driver/g' -e 's/modules/• Kernel Module/g' | cut -d " " -f2- | sed '/./,/^$/!d' | grep -A1 'VGA')
	 VIDEODRIVERS=$(echo "$VIDEODEVICES" | grep '• Kernel Driver' | awk -F' ' '{print $NF}')
	 if [ "$VIDEODRIVERS" ]; then
	  for DRIVER in $VIDEODRIVERS
	   do
	     echo "$VIDEODEVICES" | grep -EB1 "$DRIVER" >> /tmp/sysinfo-video
	     echo "$DRIVER" > /tmp/KMODULE.tmp
	     . $WORKDIR/func -sysinfo_kmodules
	     if [ "`lsmod | grep "$DRIVER"`" ]; then
	      cat /tmp/sysinfo-kernel | grep -E 'Memory Used:|Path:|Description:|^Version:' | tr -s ' ' | sed -e 's/Memory Used/• Memory Used/' -e 's/Path/• Path/' -e 's/Description/• Description/' -e 's/Version/• Driver Version/' >> /tmp/sysinfo-video
	     fi
	     echo >> /tmp/sysinfo-video
	   done
	 sed -i '$d' /tmp/sysinfo-video
	 else
	  echo -e "`lspci | grep VGA | cut -c9- | sed -e 's/:/::/' -e 's/: /\\n• /'`" >> /tmp/sysinfo-video
	 fi
	else
	 echo -e "`lspci | grep VGA | cut -c9- | sed -e 's/:/::/' -e 's/: /\\n• /'`" >> /tmp/sysinfo-video
	fi
	cat /tmp/sysinfo-video >> /tmp/pup-sysinfo.txt
	;;

-sysinfo_volumes)
	xmessage -title PSI -buttons "" -center -bg goldenrod -fg black " $(gettext 'Please wait, processing...')" &
	X7PID=$!
	echo -e "▶—— $(gettext 'Block Device Attributes') (blkid) ——◀\n" > /tmp/pup-sysinfo.txt
	blkid | sed -e 's/\/dev\///g' -e 's/: /:	/g' | sort $VER >> /tmp/pup-sysinfo.txt
	kill $X7PID
	;;

-sysinfo_whfiles) #TaZoC sysinfo
	INITRD=/initrd
	[ ! -d $INITRD ] && [ -d /aufs ] && INITRD=/aufs
	echo -e "▶—— $(gettext 'Whiteout files in') /bin /etc /lib /sbin /usr ——◀\n" > /tmp/pup-whfiles
	cd ${INITRD}/
	find ./pup_r*/bin ./pup_r*/etc ./pup_r*/lib ./pup_r*/sbin ./pup_r*/usr -noleaf -type f -name ".wh.*" | sed -e "s%^\.%$INITRD%g" >> /tmp/pup-whfiles
	[ "`grep '.wh' /tmp/pup-whfiles`" = "" ] && echo "$(gettext 'No whiteout(.wh.*) files are detected in') /bin /etc /lib /sbin /usr" > /tmp/pup-whfiles
	cat /tmp/pup-whfiles | tail -n 2000 > /tmp/pup-sysinfo.txt
	rm -f /tmp/pup-whfiles
	;;

-sysinfo_xerrslog)
	if [ "`cat /tmp/xerrs.log`" ]; then
	 grep -v '‘' /tmp/xerrs.log 2>/dev/null | tail -n 1200 | sed -e 's/[©®–✫]//g' -e '/./,/^$/!d' >> /tmp/pup-sysinfo.txt
	 sed -i -e 's/▶——/====>/g' -e 's/——◀/<====/g' -e 's/▶/=>/g' -e 's/▸/=>/g' -e 's/•/+/g' -e 's/—/-/g' -e 's/–/-/g' /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in') /tmp/xerrs.log." >> /tmp/pup-sysinfo.txt
	fi
	;;

-sysinfo_xorg.conf)
	if [ "`cat /etc/X11/xorg.conf`" ]; then
	 cat /etc/X11/xorg.conf >> /tmp/pup-sysinfo.txt
	else
	 echo "$(gettext 'No information is detected in') /etc/X11/xorg.conf." >> /tmp/pup-sysinfo.txt
	fi
	;;

esac
