#!/bin/bash # Copyright 2008, Evan Y. Chu. # For technical information, please contact Evan Y. Chu at www.evanchu.com. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ########## # This script collects basic diagnostic information # related to sharing files between Linux and Windows. read -p "enter other computer's IP address and press enter: " targetIp read -p "enter other computer's name and press enter: " targetName echo "##########" echo "basic TCP/IP info" ifconfig echo "----" route -n echo "----" cat /etc/resolv.conf echo "----" cat /etc/hosts read -p "press enter to continue" echo "##########" echo "try pinging $targetName" ping -c 3 $targetName read -p "press enter to continue" echo "##########" echo "try pinging $targetIp" ping -n -c 3 $targetIp read -p "press enter to continue" echo "##########" echo "is $targetIp on local subnet?" ping -n -c 3 -t 1 $targetIp read -p "press enter to continue" echo "##########" echo "try Samba node status query $targetName" nmblookup -d 2 -S $targetName read -p "press enter to continue" echo "##########" echo "try Samba node status query $targetIp" nmblookup -d 2 -A $targetIp read -p "press enter to continue" echo "##########" echo "try Samba node status query on local subnet" nmblookup -d 2 '*' read -p "press enter to continue" echo "##########" echo "try Samba list services on $targetName" smbclient -d 2 -U guest -N -L $targetName read -p "press enter to continue" echo "##########" echo "try to find Samba processes" ps -e | grep '[ns]mbd' read -p "press enter to continue" echo "##########" echo "try to find smb.conf" if [ -s /etc/samba/smb.conf ]; then echo "found /etc/samba/smb.conf, please post its content to aid diagnostic" fi read -p "press enter to continue"