File tree Expand file tree Collapse file tree 1 file changed +0
-33
lines changed Expand file tree Collapse file tree 1 file changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -12,23 +12,6 @@ usage()
12
12
echo " ----------------------------------------------------------------------------------------"
13
13
}
14
14
15
- # extract and read ova.xml
16
- get_bridge ()
17
- {
18
- TMPFOLD=$( mktemp -d /tmp/xvaXXXX)
19
- tar -xf " ${XVA_NAME} " -C " ${TMPFOLD} " ova.xml
20
- chmod +r " ${TMPFOLD} /ova.xml"
21
- XML_VALUE=$( grep -oE " <member><name>bridge</name><value>[^<]*</value></member>" " ${TMPFOLD} /ova.xml" )
22
- LENGTH=${# XML_VALUE}
23
- PREFIX_LENGTH=$(( ${LENGTH} - 17 ))
24
- NETWORK_VALUE=$( cut -c 1-${PREFIX_LENGTH} <<< ${XML_VALUE} )
25
- echo $( cut -c 35-${# NETWORK_VALUE} <<< ${NETWORK_VALUE} )
26
-
27
- if [ -d " ${TMPFOLD} " ]; then
28
- rm -Rf " ${TMPFOLD} "
29
- fi
30
- }
31
-
32
15
# check parameters and prompt the usage if needed
33
16
if [ -z " ${1+set} " ]
34
17
then
70
53
BRIDGE_VALUE=$3
71
54
fi
72
55
73
- # we want to know the value of the network bridge.
74
- # then we can decide if we need to change it or not.
75
- BRIDGE_READVALUE=$( get_bridge)
76
-
77
- if [ -z " ${BRIDGE_READVALUE} " ]
78
- then
79
- echo " No bridge value detected in the xml file!"
80
- exit 1
81
- else
82
- if [ " ${BRIDGE_READVALUE} " == " ${BRIDGE_VALUE} " ]
83
- then
84
- echo " The bridge is already ${BRIDGE_VALUE} . Nothing to do."
85
- exit 0
86
- fi
87
- fi
88
-
89
56
# we detect the compression method of the xva to uncompress it right
90
57
OLD_COMPRESSION=$( file -b " ${XVA_NAME} " | cut -f 1 -d " " )
91
58
if [ " ${OLD_COMPRESSION} " != " Zstandard" ] && [ " ${OLD_COMPRESSION} " != " gzip" ] && [ " ${OLD_COMPRESSION} " != " tar" ]; then
You can’t perform that action at this time.
0 commit comments