/usr/share/sadms-2.0.15/_test-domainjoin.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 | #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:34:54
# _test-domain.sh
### P A R A M S
MYVERBOSE=
redirection='> /dev/null'
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
redirection=
shift
fi
### I N C L U D E
. ./_include.sh
### S T A R T
echo "--------------------------------------------------------------------------------"
echo "DOMAIN TEST"
echo "--------------------------------------------------------------------------------"
echo "+DOMAIN"
domain=`wbinfo --own-domain`
if [ ! -z "${domain}" ]; then
echo "${domain}"
else
echo "unknown"
fi
echo "+CHECK JOIN TO DOMAIN ${MYREALM}"
e="net ads testjoin -P ${redirection} 2>&1 "
#echo ${e}
eval ${e}
if [ "$?" = "0" ]; then
echo "joined to domain"
echo "+DOMAIN INFORMATION"
net ads info | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
if [ ! -z "${MYVERBOSE}" ]; then
echo "+LDAP"
net ads lookup ldap | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
echo "+KDC"
net ads lookup kdc | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
echo "+DC"
net ads lookup dc | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
echo "+MASTER"
net ads lookup master | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
echo "+CHECK TRUST SECRET"
wbinfo --check-secret | sed 's/[[:space:]]\+/ /g' | grep -v '^$'
fi
else
echo "not joined to domain" >&2
exit 1
fi
exit 0
|