#Dialup and wireless-modem
[ -s /etc/wvdial.conf ] && sed -e 's/^\(Username *= *\).*/\1(removed by pdiag)/' \
 -e 's/^\(Password *= *\).*/\1(removed by pdiag)/' \
 -e 's/\(AT+CPIN=\)..*/\1(removed by pdiag)/' \
 /etc/wvdial.conf > $DIAGSUBDIR/wvdial.conf.txt 2> /dev/null
cp -f /tmp/pupdial.log $DIAGSUBDIR/ 2> /dev/null
cp -f /etc/ppp/peers/wvdial $DIAGSUBDIR/ 2> /dev/null
cp -f /tmp/logwvdialprobe $DIAGSUBDIR/ 2> /dev/null
grep -E 'agrmodem|intelmodem' /lib/modules/?.?.*/modules.dep > $DIAGSUBDIR/grep-modem-modules_dep.txt 2> /dev/null || rm -f $DIAGSUBDIR/grep-modem-modules_dep.txt

[ -d /tmp/.pgprs ] && grep '' /tmp/.pgprs/* 2> /dev/null | sed -e 's%/tmp/\.pgprs/%%' -e 's/:/: /' > $DIAGSUBDIR/grep-tmp-.pgprs.txt
[ -d /tmp/.frisbee ] &&  grep '' /tmp/.frisbee/* 2> /dev/null | sed -e 's%/tmp/\.frisbee/%%' -e 's/:/: /' > $DIAGSUBDIR/grep-tmp-.frisbee.txt
[ -d /etc/ppp/peers ] && grep '' /etc/ppp/peers/* 2> /dev/null | sed -e 's%/etc/ppp/peers/%%' -e 's/:/: /' > $DIAGSUBDIR/grep-etc-ppp-peers.txt
[ -d /etc/ppp/chatscripts ] && grep '' /etc/ppp/chatscripts/* 2> /dev/null | sed -e 's%/etc/ppp/chatscripts/%%' -e 's/:/: /' > $DIAGSUBDIR/grep-etc-ppp-chatscripts.txt
[ -d /etc/ppp ] && grep '' /etc/ppp/options* 2> /dev/null | sed -e 's%/etc/ppp/%%' -e 's/:/: /' > $DIAGSUBDIR/grep-etc-ppp-options.txt
cp -f /etc/ppp/connect-errors $DIAGSUBDIR/ 2> /dev/null
cp -f /etc/ppp/if-up $DIAGSUBDIR/ 2> /dev/null
cp -f /etc/ppp/if-down $DIAGSUBDIR/ 2> /dev/null
cp -f /etc/ppp/gprs.conf $DIAGSUBDIR/gprs.conf-etc_ppp 2> /dev/null
cp -f /root/.config/gprs.conf $DIAGSUBDIR/gprs.conf-root_.config 2> /dev/null
cp -f /tmp/.gprs_connect.log $DIAGSUBDIR/gprs_connect.log 2> /dev/null
lsusb -v &> $DIAGSUBDIR/lsusb.txt

grep -H -s 'Interrupt' /sys/bus/usb/devices/*-*:*.*/ep_??/type 2> /dev/null | sed -e 's%/sys/bus/usb/devices%%' -e 's/:/: /' > $DIAGSUBDIR/grep-sys-bus-usb-devices-ep-type-interrupt.txt

cp -f /tmp/ozerocdoff.log $DIAGSUBDIR/ 2> /dev/null
cp -f /tmp/osetsuspend.log $DIAGSUBDIR/ 2> /dev/null
if [ "`lsmod | grep '^hso '`" != "" ];then
 ls -1 /sys/class/tty/ttyHS* > $DIAGSUBDIR/ls-ttyHS.txt 2> /dev/null
 TTYS=`find /sys/class/tty -name "ttyHS*"`
 for i in $TTYS; do
  echo "$i/hsotype: `cat $i/hsotype`" >> $DIAGSUBDIR/ttyHS_hsotypes
 done
fi
cp -f /tmp/udevtrace-modem.log $DIAGSUBDIR/ 2> /dev/null

#For reworked modem support in Wary/Quirky+:
cp -f /tmp/pupdial_port_test $DIAGSUBDIR/ 2> /dev/null
cp -f /var/local/pupdial/usb_modem_port $DIAGSUBDIR/ 2> /dev/null
cp -f /var/local/pupdial/usbids $DIAGSUBDIR/ 2> /dev/null

