/usr/share/sadms-2.0.15/_test-nmb.sh is in sadms 2.0.15.repack-0ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:31:48
# _test-nmb.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
shift
fi
MYDNS="$1"
MYDOMAIN="$2"
MYDC="$3"
MYSERVER="$4"
MYHOSTALLOW="$5"
MYWINS="$6"
### I N C L U D E
. ./_include.sh
### S T A R T
echo "--------------------------------------------------------------------------------"
echo "NMB TEST"
echo "--------------------------------------------------------------------------------"
function resolve()
{
if [ "$3" == "all" ]; then
nmblookup $1 $2 '*'
else
nmblookup $1 $2 $3
fi
}
function resolveAll()
{
nmblookup '*'
}
function nodeStatus()
{
echo "node status on $1"
nmblookup -A $1
echo "=$?"
}
echo "+PORT LISTENING"
output=`netstat -a | grep netbios`
echo ${output}
echo ${output} | grep 'netbios-ns'
if [ "$?" == "0" ]; then
echo "name service listening"
else
echo "name service not listening" >&2
fi
echo "+QUERIES"
resolve -B localhost __SAMBA__
resolve -B ${MYSERVER} all
echo "+QUERY ALL REGISTERED NAMES"
resolveAll
#echo "+QUERY NODE STATUS"
#nodeStatus ${MYSERVER}
#nodeStatus ${MYDC}
|