-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdumpwebui.sh
More file actions
executable file
·36 lines (31 loc) · 1.12 KB
/
Copy pathdumpwebui.sh
File metadata and controls
executable file
·36 lines (31 loc) · 1.12 KB
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
#!/bin/bash
starttime=`date +"%y-%m-%d_%H-%m-%s"`
OUTFILE=xmswebuidump-$starttime
if [ $# -eq 1 ]; then
OUTFILE=$1
fi
OAMHOST="127.0.0.1"
OAMPORT="10080"
dumpsubs(){
local CURPATH=$1
local RESPONSE="$(curl -s http://$OAMHOST:$OAMPORT$CURPATH)"
echo -e "------------------------------------------------------------------------------"
echo -e "$CURPATH"
echo -e "------------------------------------------------------------------------------"
echo -e "$RESPONSE"
local ITEMS="$(echo -e "$RESPONSE" |grep uri | grep resource | awk -F'"' '{print $2}')"
#echo $ITEMS
for item in $ITEMS
do
dumpsubs "$CURPATH/$item"
done
}
echo "" > $OUTFILE
echo -e "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | tee -a $OUTFILE
echo -e "XMS WebUI Dump" | tee -a $OUTFILE
echo -e "host: `hostname`" | tee -a $OUTFILE
echo -e "OAM: http://$OAMHOST:$OAMPORT" | tee -a $OUTFILE
echo -e "starttime: $starttime" | tee -a $OUTFILE
echo -e "Outfile: $OUTFILE" | tee -a $OUTFILE
echo -e "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | tee -a $OUTFILE
dumpsubs "" | tee -a $OUTFILE