Produced by Araxis Merge on 4/11/2017 10:47:23 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | Tue Apr 11 15:47:23 2017 UTC | ||
2 | PS_PPS_Weblogic_Domain\install\domain_template.jar\bin\server_migration | wlsifconfig.sh | Fri Oct 7 07:11:04 2016 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 0 | 0 |
Changed | 0 | 0 |
Inserted | 1 | 541 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | #!/bin/sh | |||||
2 | # | |||||
3 | # Addition al command s to suppo rt node ma nager ip m igration. | |||||
4 | # | |||||
5 | # Prints o ut list of available network i nterfaces and associ ated ip ad dresses. | |||||
6 | # And for HP-UX, it prints out the last used netwo rk interfa ce and | |||||
7 | # associat ed ip addr esse. | |||||
8 | # | |||||
9 | listif() | |||||
10 | { | |||||
11 | case " $OS" in | |||||
12 | Linux\ 2.*) | |||||
13 | /sbin/ip - o addr sho w "$INTERF ACE" | | |||||
14 | # ip prints ou t a number followed by a colon [0-9]*: | |||||
15 | # th en the mai n interfac e name, "l o" in the example be low | |||||
16 | # th en some wh itespace f ollowed by "inet" or "inet6" | |||||
17 | # th en the add ress we ar e interest ed in, fol lowed by s copes and other info rmation we are not i nterested in | |||||
18 | # fi nally foll owed by th e interfac e and subi nterface | |||||
19 | ||||||
20 | #exa mple: | |||||
21 | #1: lo inet 127.0.0.1 /8 scope h ost lo | |||||
22 | #1: lo inet 6 ::1/128 scope host \ v alid_lft f orever pre ferred_lft forever | |||||
23 | ||||||
24 | # fi rst match addresses and sub in terfaces f or ipv4 fo rmat | |||||
25 | # 0- 9. | |||||
26 | sed -n 's?.*in et \([0-9. ]*\)\/[0-9 ]* .* \([^ ]*\)?\2 \ 1?p' | |||||
27 | ||||||
28 | # no w match ad dresses an d interfac es for ipv 6 format | |||||
29 | # a- zA-z0-9: | |||||
30 | /sbi n/ip -o ad dr show "$ INTERFACE" | | |||||
31 | sed -n 's?[0-9 ]*: \(.*[a -zA-Z0-9]* \)\ .*inet 6 \([a-zA- Z0-9:]*\)\ /[0-9]* .* \([^ ]*\) ?\1 \2?p' | |||||
32 | ;; | |||||
33 | Darwin *) | |||||
34 | ty peset addr | |||||
35 | fo r i in `/s bin/ifconf ig -l` | |||||
36 | do | |||||
37 | addr=`/u sr/sbin/ip config $i 2>$NullDev ice` && ec ho "$i $ad dr" | |||||
38 | do ne | |||||
39 | ;; | |||||
40 | HP-UX* ) | |||||
41 | $N ETSTAT | g rep $INTER FACE | ${A WK:-awk} ' {print $1} ' > $tempf ile1 | |||||
42 | fo r i in `ca t $tempfil e1` | |||||
43 | do | |||||
44 | echo "$i " | ${AWK: -awk} -F": " '{print $2}' >> $t empfile2 | |||||
45 | do ne | |||||
46 | so rt -r $tem pfile2 > $ tempfile1 | |||||
47 | ma xInterface =`head -1 $tempfile1 ` | |||||
48 | if [ x$maxIn terface = x ]; then | |||||
49 | maxInter face=0 | |||||
50 | LAST_UP_ INTERFACE= $INTERFACE | |||||
51 | el se | |||||
52 | LAST_UP_ INTERFACE= "$INTERFAC E:$maxInte rface" | |||||
53 | fi | |||||
54 | ||||||
55 | $N ETSTAT | g rep $LAST_ UP_INTERFA CE | ${AWK :-awk} '{p rint $1": "$4}' | un iq | |||||
56 | ;; | |||||
57 | SunOS* ) | |||||
58 | $I FCONFIG $I FCONFIGOPT S | ${AWK: -awk} -v t his_if=$IN TERFACE 'B EGIN { | |||||
59 | if_pat = "^" thi s_if ".*" | |||||
60 | } | |||||
61 | { | |||||
62 | if ($0 ~ if_pat) { | |||||
63 | cur _if=$1 | |||||
64 | get line | |||||
65 | if ($1 ~ "ine t") { | |||||
66 | sub(/addr: /,"",$2); | |||||
67 | sub(/\/.*? /,"",$2); | |||||
68 | print cur_ if " " $2 | |||||
69 | } | |||||
70 | } | |||||
71 | }' | |||||
72 | ;; | |||||
73 | AI X*) | |||||
74 | $N ETSTAT | g rep $INTER FACE | ${A WK:-awk} ' {print $1" : "$4}' | uniq | |||||
75 | ;; | |||||
76 | *) ec ho "Server migration not suppo rted on th is platfor m" >&2 | |||||
77 | ex it 1 | |||||
78 | ;; | |||||
79 | esac | |||||
80 | } | |||||
81 | ||||||
82 | # | |||||
83 | # Prints o ut list of available network i nterfaces and associ ated ip ad dresses | |||||
84 | # on windo ws 2000 or later sys tems. | |||||
85 | # | |||||
86 | ||||||
87 | listif_nt( ) | |||||
88 | { | |||||
89 | netsh i nterface i p show add ress "$INT ERFACE" | grep -e '[ ^ ]*IP' >&2 | |||||
90 | } | |||||
91 | ||||||
92 | # | |||||
93 | # Removes an added f loating IP address. It depend s on the O S utilitie s to | |||||
94 | # achieve this. | |||||
95 | # | |||||
96 | ||||||
97 | removeif() | |||||
98 | { | |||||
99 | grep $ ADDRESS $A ddrFile >$ NullDevice 2>&1 | |||||
100 | if [ $ ? != 0 ]; then | |||||
101 | ech o "Cannot remove $AD DRESS - n ot brought online" > &2 | |||||
102 | exi t 1 | |||||
103 | fi | |||||
104 | ||||||
105 | if ech o $OS | gr ep '^HP-U X' >$NullD evice 2>&1 ; then | |||||
106 | # Extract th e interfac e to which ADDRESS i s assigned . | |||||
107 | if _toberemov ed=`$NETST AT | grep $ADDRESS | ${AWK:-a wk} '{prin t $1}'` | |||||
108 | # Now check if this ex tracted in terface is a sub-int erface of incoming I NTERFACE | |||||
109 | # or itself. If not, r aise error and exit. | |||||
110 | ec ho $if_tob eremoved | grep $INT ERFACE >$N ullDevice 2>&1 | |||||
111 | if [ $? != 0 -o -z $if _toberemov ed -o x$if _toberemov ed = x ]; then | |||||
112 | echo "Ca nnot remov e $ADDRESS - It is n ot online at '$INTER FACE' or a ny of its sub-interf aces" >&2 | |||||
113 | exit 1 | |||||
114 | fi | |||||
115 | ec ho "Execut ing comman d - '$SUDO $IFCONFIG $if_tober emoved dow n' AND '$S UDO $IFCON FIG $if_to beremoved 0.0.0.0'" | |||||
116 | $S UDO $IFCON FIG $INET6 $if_tober emoved dow n | |||||
117 | $S UDO $IFCON FIG $INET6 $if_tober emoved 0.0 .0.0 | |||||
118 | elif | |||||
119 | ec ho $OS | g rep '^AIX *' >$NullD evice 2>&1 ; then | |||||
120 | $S UDO $IFCON FIG $INTER FACE $INET 6 $ADDRESS delete | |||||
121 | elif | |||||
122 | ec ho $OS | g rep '^Sun OS 5.' >$N ullDevice 2>&1; then | |||||
123 | if_tober emoved=$IN TERFACE | |||||
124 | $SUDO $I FCONFIG $I NTERFACE $ INET6 remo veif $ADDR ESS | |||||
125 | elif [ "x$INET6" = "xinet6 " ]; then | |||||
126 | if_toberem oved=$INTE RFACE | |||||
127 | echo "Exec uting comm and - '$SU DO $IFCONF IG $INTERF ACE $INET6 del $ADDR ESS_AND_MA SK" | |||||
128 | $SUDO $IFC ONFIG $INT ERFACE $IN ET6 del $A DDRESS_AND _MASK | |||||
129 | else | |||||
130 | se t -- `list if | grep "^$INTERFA CE:.* $ADD RESS$"` | |||||
131 | if _toberemov ed=$1 | |||||
132 | ||||||
133 | if [ -n "$if _toberemov ed" ]; the n | |||||
134 | $SUDO $I FCONFIG $1 down | |||||
135 | el se | |||||
136 | echo "Ca nnot remov e $ADDRESS - It is n ot online at '$INTER FACE' or a ny of its sub-interf aces" >&2 | |||||
137 | exit 1 | |||||
138 | fi | |||||
139 | fi | |||||
140 | ||||||
141 | case " $?" in | |||||
142 | 0) echo "Succ essfully r emoved $AD DRESS_AND_ MASK from $if_tobere moved." | |||||
143 | ;; | |||||
144 | *) echo "Fail ed to remo ve $ADDRES S_AND_MASK from $if_ toberemove d." >&2 | |||||
145 | exit 1 | |||||
146 | ;; | |||||
147 | esac | |||||
148 | ||||||
149 | cleanA ddressFile | |||||
150 | } | |||||
151 | ||||||
152 | # | |||||
153 | # Checks i f an addre ss is in t he Address file, and if it is | |||||
154 | # it delet es that fr om the fil e | |||||
155 | # | |||||
156 | ||||||
157 | cleanAddre ssFile() | |||||
158 | { | |||||
159 | if [ - f $AddrFil e ]; then | |||||
160 | if grep $ADD RESS $Addr File >$Nul lDevice 2> &1; then | |||||
161 | echo `se d '/'$ADDR ESS'/ d' < $AddrFile ` > $AddrF ile | |||||
162 | fi | |||||
163 | ||||||
164 | if grep $ADD RESS $Addr File >$Nul lDevice 2> &1; then | |||||
165 | echo "re move by se d FAILED! $AddrFile still con tains %ADD RESS%" | |||||
166 | exit 1 | |||||
167 | fi | |||||
168 | fi | |||||
169 | ||||||
170 | } | |||||
171 | ||||||
172 | ||||||
173 | ||||||
174 | # | |||||
175 | # Removes an added f loating IP address. It depend s on the O S utilitie s to | |||||
176 | # achieve this. Win dows 2000+ support | |||||
177 | # | |||||
178 | ||||||
179 | removeif_n t() | |||||
180 | { | |||||
181 | grep $ ADDRESS $A ddrFile >$ NullDevice 2>&1 | |||||
182 | if [ $ ? != 0 ]; then | |||||
183 | ech o "Cannot remove $AD DRESS - n ot brought online" > &2 | |||||
184 | exi t 1 | |||||
185 | fi | |||||
186 | ||||||
187 | netout =`netsh in terface ip delete ad dress "$IN TERFACE" $ addr >&2` | |||||
188 | ||||||
189 | if [ $ ? != 0 ]; then | |||||
190 | ech o "Unable to remove $ADDRESS - Check com mand outpu t" >&2 | |||||
191 | ech o "$netout " >&2 | |||||
192 | exi t 1 | |||||
193 | fi | |||||
194 | cleanA ddressFile | |||||
195 | } | |||||
196 | ||||||
197 | # | |||||
198 | # Adds a n ew IP in a subinterf ace of giv en interfa ce. If th e IP is al ready | |||||
199 | # online o n this ma chine, the n if ENABL ESCRIPTIPC HECK is se t, then th is will | |||||
200 | # report f ailure. | |||||
201 | # Invalid Interface or other configurat ion issues (like net masks etc) will | |||||
202 | # cause t his functi on to fail | |||||
203 | # | |||||
204 | ||||||
205 | addif() | |||||
206 | { | |||||
207 | # Allo w awk to b e set to n awk for so me systems which sti ll | |||||
208 | # ship the ancie nt version of awk | |||||
209 | newif= `listif | ${AWK:-awk } -v this _if="$INTE RFACE" -v this_ip=$A DDRESS 'BE GIN { | |||||
210 | cnt = 0; | |||||
211 | if_pat = " ^" this_if ".*$" | |||||
212 | found=0 | |||||
213 | if_matched =0 | |||||
214 | new_if="" | |||||
215 | } | |||||
216 | { | |||||
217 | if ($1 ~ i f_pat && ! found) { | |||||
218 | if_match ed = 1 | |||||
219 | if ($2 = = this_ip) { | |||||
220 | new_if = $1 | |||||
221 | found= 1 | |||||
222 | n = sp lit( $1,x, /:/) | |||||
223 | baseif = n == 1 ? 1 : 0; | |||||
224 | } | |||||
225 | else { | |||||
226 | n = sp lit( $1,x, /:/) | |||||
227 | if (x[ 2] > cnt) { | |||||
228 | cnt = n == 1 ? 0 : x[2] | |||||
229 | } | |||||
230 | } | |||||
231 | } | |||||
232 | } | |||||
233 | EN D { | |||||
234 | if (!if_ma tched) | |||||
235 | new_if = "unknown -if" | |||||
236 | else if (! found) | |||||
237 | new_if = this_if ":" cnt + 1 | |||||
238 | else { | |||||
239 | if (bas eif) | |||||
240 | new_i f = "alrea dy-online- on-baseif" | |||||
241 | else | |||||
242 | new_i f = "alrea dy-online" | |||||
243 | } | |||||
244 | print new_ if | |||||
245 | }' ` | |||||
246 | if [ " x$newif" = "xunknown -if" ]; th en | |||||
247 | ec ho "Unknow n interfac e $INTERFA CE" >&2 | |||||
248 | ex it 1 | |||||
249 | elif [ "x$newif" != "xalre ady-online " -a "x$ne wif" != "x already-on line-on-ba seif" ]; t hen | |||||
250 | cl eanAddress File | |||||
251 | if echo $OS | grep '^ HP-UX' >$N ullDevice 2>&1; then | |||||
252 | echo "Ge nerated co mmand - $S UDO $IFCON FIG $newif $INET6 $A DDRESS_AND _MASK up" | |||||
253 | $SUDO $I FCONFIG $n ewif $INET 6 $ADDRESS _AND_MASK up | |||||
254 | el if echo $O S | grep '^AIX*' >$ NullDevice 2>&1; the n | |||||
255 | echo "$OS " | |||||
256 | echo "Ge nerated co mmand - $S UDO $IFCON FIG $INTER FACE $INET 6 $ADDRESS _AND_MASK up alias" | |||||
257 | $SUDO $I FCONFIG $I NTERFACE $ INET6 $ADD RESS_AND_M ASK up ali as | |||||
258 | elif e cho $OS | grep '^Su nOS 5.' >$ NullDevice 2>&1; the n | |||||
259 | echo "Ge nerated co mmand - $S UDO $IFCON FIG $INTER FACE $INET 6 addif $A DDRESS_AND _MASK up" | |||||
260 | $SUDO $I FCONFIG $I NTERFACE $ INET6 addi f $ADDRESS _AND_MASK up | |||||
261 | elif [ "x$INET6" = "xinet6 " ]; then | |||||
262 | ec ho "Genera ted comman d - $SUDO $IFCONFIG $INTERFACE $INET6 ad d $ADDRESS _AND_MASK" | |||||
263 | $S UDO $IFCON FIG $INTER FACE $INET 6 add $ADD RESS_AND_M ASK | |||||
264 | el se | |||||
265 | echo "Generate d command - $SUDO $I FCONFIG $n ewif $ADDR ESS_AND_MA SK" | |||||
266 | $SUD O $IFCONFI G $newif $ ADDRESS_AN D_MASK | |||||
267 | ||||||
268 | fi | |||||
269 | ||||||
270 | if [ $? = 0 ] ; then | |||||
271 | cleanAdd ressFile | |||||
272 | echo $AD DRESS >> $ AddrFile | |||||
273 | if echo $OS | grep '^Linux' >$NullDev ice 2>&1; then | |||||
274 | ||||||
275 | $SUDO /sbin/arp ing $MACBR OADCAST -q -c 3 -A - I $INTERFA CE $ADDRES S > $NullD evice 2>&1 | |||||
276 | ||||||
277 | # That should be enough, b ut if ther e are host s out ther e which ig nore | |||||
278 | # grat uitous ARP replies a nd do not even purge the ARP c ache | |||||
279 | # try to send so me gratuit ous ARP re quests | |||||
280 | # | |||||
281 | ||||||
282 | $SUDO /sbin/arp ing -q -c 3 -U -I $I NTERFACE $ ADDRESS > $NullDevic e 2>&1 | |||||
283 | ||||||
284 | fi | |||||
285 | echo "Su ccessfully brought $ ADDRESS_AN D_MASK onl ine on $ne wif" | |||||
286 | el se | |||||
287 | echo "Fa iled to br ing $ADDRE SS_AND_MAS K online o n $newif" >&2 | |||||
288 | exit 1 | |||||
289 | fi | |||||
290 | else | |||||
291 | if [ x$newif = xalread y-online-o n-baseif ] ; then | |||||
292 | echo "$ADD RESS alrea dy online on $INTERF ACE, but o n the base interface . This ca n lead of network co nnectivity when the interface is brought down" >&2 | |||||
293 | exit 1 | |||||
294 | fi | |||||
295 | if [ x$ENABL ESTRICTIPC HECK = xY ]; then | |||||
296 | echo "$ADD RESS alrea dy online on $INTERF ACE. Plea se make su re that th e IP addre ss $ADDRES S is not u sed by oth er servers /applicati ons" >&2 | |||||
297 | cleanAddre ssFile | |||||
298 | exit 1 | |||||
299 | el se | |||||
300 | echo "$ADD RESS alrea dy online on $INTERF ACE. Plea se make su re that th e IP addre ss specifi ed is not used by ot her server s/applicat ions. Con tinuing... " >&2 | |||||
301 | cleanAddre ssFile | |||||
302 | echo $ADDR ESS >> $Ad drFile | |||||
303 | fi | |||||
304 | fi | |||||
305 | } | |||||
306 | ||||||
307 | # | |||||
308 | # IP add f unction fo r Windows 2000+ syst ems. Depe nds on net sh utlitie s and | |||||
309 | # cygwin | |||||
310 | # | |||||
311 | ||||||
312 | addif_nt() | |||||
313 | { | |||||
314 | newif= `listif_nt 2>&1 | ${ AWK:-awk} -v this_i f="$INTERF ACE" -v th is_ip=$ADD RESS 'BEGI N { | |||||
315 | if_pat = " ^Configura tion for i nterface.* " this_if ".*$" | |||||
316 | ip_pat = " ^IP Addres s:.*" $ADD RESS ".*$" | |||||
317 | found=0 | |||||
318 | if_matched =0 | |||||
319 | } | |||||
320 | { | |||||
321 | # print "C urrent lin e ", $0 | |||||
322 | if ($0 ~ i f_pat) { | |||||
323 | # print "if_matche d" | |||||
324 | if_match ed = 1 | |||||
325 | } | |||||
326 | if (if_mat ched && ($ 0 ~ ip_pat )) { | |||||
327 | # print "ip_match ed" | |||||
328 | found= 1 | |||||
329 | } | |||||
330 | } | |||||
331 | EN D { | |||||
332 | if (!if_ma tched) | |||||
333 | new_if = "unknown -if" | |||||
334 | else if (! found) | |||||
335 | new_if = this_if | |||||
336 | else | |||||
337 | new_if = "already -online" | |||||
338 | print new_ if | |||||
339 | }' ` | |||||
340 | if [ " x$newif" = "xunknown -if" ]; th en | |||||
341 | cl eanAddress File | |||||
342 | ec ho "Unknow n interfac e \"$INTER FACE\"" >& 2 | |||||
343 | ex it 1 | |||||
344 | elif [ "x$newif" != "xalre ady-online " ]; then | |||||
345 | cl eanAddress File | |||||
346 | ne tout=`nets h interfac e ip add a ddress "$I NTERFACE" $ADDRESS $ NETMASK >& 2` | |||||
347 | if [ $? = 0 ] ; then | |||||
348 | cleanAdd ressFile | |||||
349 | echo $AD DRESS >> $ AddrFile | |||||
350 | ||||||
351 | el se | |||||
352 | echo "Fa iled to br ing $ADDRE SS_AND_MAS K online o n $newif" >&2 | |||||
353 | echo "$n etout" >&2 | |||||
354 | cleanAdd ressFile | |||||
355 | exit 1 | |||||
356 | fi | |||||
357 | else | |||||
358 | if [ x$ENABL ESTRICTIPC HECK = xY ]; then | |||||
359 | echo "$ADD RESS alrea dy online on $INTERF ACE. Plea se make su re that th e IP addre ss $ADDRES S is not u sed by oth er servers /applicati ons" >&2 | |||||
360 | cleanAddre ssFile | |||||
361 | el se | |||||
362 | echo "$ADD RESS alrea dy online on $INTERF ACE. Plea se make su re that th e IP addre ss specifi ed is not used by ot her server s/applicat ions. Con tinuing... " | |||||
363 | cleanAddre ssFile | |||||
364 | echo $ADDR ESS >> $Ad drFile | |||||
365 | fi | |||||
366 | ex it 1 | |||||
367 | fi | |||||
368 | } | |||||
369 | ||||||
370 | # Check wh ether para meter IP a ddress is ipv6. Retu rn 0:IPv6; 1:not | |||||
371 | # $1: the ip address to check | |||||
372 | isIPv6(){ | |||||
373 | local ipAddress= "$1" | |||||
374 | case " $ipAddress " in | |||||
375 | *::*) | |||||
376 | re turn 0 | |||||
377 | ;; | |||||
378 | esac | |||||
379 | ||||||
380 | theCou nter=`echo "$ipAddre ss" | ${AW K:-awk} -F ":" '{prin t NF-1}'` | |||||
381 | if [ $ theCounter -gt 3 ]; then | |||||
382 | re turn 0 | |||||
383 | else | |||||
384 | re turn 1 | |||||
385 | fi | |||||
386 | } | |||||
387 | ||||||
388 | # detect w hether ADD RESS is ip v6, and se t INET6 ac cordingly | |||||
389 | detect_IPV 6(){ | |||||
390 | if ( i sIPv6 $ADD RESS ); th en | |||||
391 | IN ET6="inet6 " | |||||
392 | expo rt INET6 | |||||
393 | fi | |||||
394 | } | |||||
395 | ||||||
396 | ||||||
397 | usage_erro r() | |||||
398 | { | |||||
399 | cat <<!!EO F >&2 | |||||
400 | Usage: `ba sename $0` | |||||
401 | -ad dif <inter face-name> <ip-addre ss> [netma sk|prefixl ength] | |||||
402 | -re moveif <in terface-na me> <ip-ad dress> [pr efixlength ] | |||||
403 | -li stif <inte rface-name > | |||||
404 | ||||||
405 | 'add if' adds < ip-address > to next available sub-interf ace of <in terface-na me>. | |||||
406 | 'rem oveif' rem oves <ip-a ddress> fr om sub-int erface of <interface -name>. | |||||
407 | 'lis tif' lists last used sub-inter face of <i nterface-n ame> and i ts corresp onding <ip -address> | |||||
408 | fo r HP-UX pl atform AND it lists <interface -name> and its corre sponding < ip-address > for othe r platform s. | |||||
409 | ||||||
410 | To f ind the li st of inte rfaces, us e your OS utility. On Unix-li ke | |||||
411 | syst ems, '/sbi n/ifconfig ' or '/usr /sbin/ifco nfig' will list all the interf aces. | |||||
412 | ||||||
413 | On W indows 200 0 or later systems, use the fo llowing co mmand to l ist the in terface na mes- | |||||
414 | nets h interfac e show int erface. | |||||
415 | !!EOF | |||||
416 | exit 1 | |||||
417 | } | |||||
418 | ||||||
419 | #set -vx | |||||
420 | ||||||
421 | # Parse in terface na me | |||||
422 | [ $# -lt 1 ] && usag e_error | |||||
423 | ||||||
424 | # Parse co mmand and options | |||||
425 | INTERFACE= ADDRESS= NETMASK= | |||||
426 | ||||||
427 | case "$1" in | |||||
428 | -addif ) COMM AND=addif | |||||
429 | INTE RFACE="$2" | |||||
430 | ADDR ESS="$3" | |||||
431 | [ -n "$4" ] && NETMASK=" $4" && PRE FIXLENGTH= "$4" | |||||
432 | [ -z "$INTERFA CE" -o -z "$ADDRESS" ] && usag e_error | |||||
433 | case "$OS" in | |||||
434 | Linux\ 2.* ) | |||||
435 | if [ x$NET MASK = x ] ; then | |||||
436 | usage_ error; fi | |||||
437 | ;; | |||||
438 | esac | |||||
439 | ;; | |||||
440 | -remov eif) COMM AND=remove if | |||||
441 | INTE RFACE="$2" | |||||
442 | ADDR ESS="$3" | |||||
443 | [ -n "$4" ] && PREFIXLEN GTH="$4" | |||||
444 | [ -z "$INTERFA CE" -o -z "$ADDRESS" ] && usag e_error | |||||
445 | ;; | |||||
446 | -listi f) COMM AND=listif | |||||
447 | INTE RFACE="$2" | |||||
448 | [ -z "$INTERFA CE" ] && u sage_error | |||||
449 | ;; | |||||
450 | -test) retu rn # inte rnal usage only | |||||
451 | ;; | |||||
452 | *) usag e_error | |||||
453 | ;; | |||||
454 | esac | |||||
455 | ||||||
456 | IFCONFIG=/ sbin/ifcon fig | |||||
457 | IFCONFIGOP TS=-a | |||||
458 | NullDevice =/dev/null | |||||
459 | export Nul lDevice | |||||
460 | LAST_UP_IN TERFACE= | |||||
461 | NETSTAT="/ usr/bin/ne tstat -ain " | |||||
462 | if [ "$Use MACBroadca st" = "tru e" ]; then | |||||
463 | MACBRO ADCAST="-b " | |||||
464 | fi | |||||
465 | ||||||
466 | # Set this to true i f IP addre ss should not be onl ine before starting | |||||
467 | # a server . Otherwi se, presen ce of an I P address in an inte rface will | |||||
468 | # cause th e script t o report s uccess on IP addif | |||||
469 | ENABLESTRI CTIPCHECK= N | |||||
470 | ||||||
471 | # If ${Ser verDir}/da ta/nodeman ager direc tory does not exist, create it . | |||||
472 | if [ ! -d ${ServerDi r}/data/no demanager ] | |||||
473 | then | |||||
474 | mkdir -p ${Serve rDir}/data /nodemanag er | |||||
475 | fi | |||||
476 | ||||||
477 | AddrFile=$ {ServerDir }/data/nod emanager/$ {ServerNam e}.addr | |||||
478 | tempfile1= ${ServerDi r}/data/no demanager/ wlsifconfi g_temp1 | |||||
479 | tempfile2= ${ServerDi r}/data/no demanager/ wlsifconfi g_temp2 | |||||
480 | rm $tempfi le1 $tempf ile2 >$Nul lDevice 2> &1 | |||||
481 | ||||||
482 | # Must hav e specifie d at least one comma nd | |||||
483 | [ -z "$COM MAND" ] && usage_err or | |||||
484 | ||||||
485 | OS="`uname -sr`" | |||||
486 | ||||||
487 | cygwin=no | |||||
488 | ||||||
489 | ||||||
490 | case $OS i n | |||||
491 | ||||||
492 | *CYGWIN_N T*) | |||||
493 | NullDevice =nul | |||||
494 | cygwin=yes ;; # Cur rently onl y cygwin s shd tested on NT | |||||
495 | ||||||
496 | HP-UX*) IFCONFIG=/ usr/sbin/i fconfig | |||||
497 | IFCONFIGOP TS=$INTERF ACE | |||||
498 | ;; | |||||
499 | AIX*) | |||||
500 | IF CONFIG=/us r/sbin/ifc onfig | |||||
501 | IFCONFIGOP TS=$INTERF ACE | |||||
502 | ;; | |||||
503 | esac | |||||
504 | ||||||
505 | nawk '{ pr int }' < $ NullDevice > $NullDe vice 2>&1 | |||||
506 | ||||||
507 | if [ $? = 0 ]; then | |||||
508 | AWK=nawk | |||||
509 | else | |||||
510 | AWK=awk | |||||
511 | fi | |||||
512 | ||||||
513 | if [ x$cyg win = xno ]; then | |||||
514 | myid=`id | sed -e 's;^.*uid =\([0-9][0 -9]*\).*$; \1;'` | |||||
515 | ||||||
516 | SUDO=sud o | |||||
517 | if [ $my id -eq 0 ] ; then | |||||
518 | SUDO= | |||||
519 | fi | |||||
520 | else | |||||
521 | SUDO= | |||||
522 | COMMAND= "${COMMAND }_nt" | |||||
523 | fi | |||||
524 | ||||||
525 | detect_IPV 6 | |||||
526 | ||||||
527 | NETMASK="n etmask $NE TMASK" | |||||
528 | if [ "$INE T6" = "ine t6" ]; the n | |||||
529 | if [ - z "$PREFIX LENGTH" ]; then | |||||
530 | AD DRESS_AND_ MASK="$ADD RESS" | |||||
531 | else | |||||
532 | ADDRESS_AN D_MASK="$A DDRESS/$PR EFIXLENGTH " | |||||
533 | fi | |||||
534 | else | |||||
535 | ADDRES S_AND_MASK ="$ADDRESS $NETMASK" | |||||
536 | fi | |||||
537 | ||||||
538 | ||||||
539 | $COMMAND | |||||
540 | exit 0 | |||||
541 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.