-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvzupgrade-post
executable file
·32 lines (28 loc) · 1.1 KB
/
vzupgrade-post
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
#!/bin/bash
#
# Copyright (c) 2017-2020 Virtuozzo International GmbH. All rights reserved.
#
# Our contact details: Virtuozzo International GmbH, Vordergasse 59, 8200
# Schaffhausen, Switzerland.
#
WAIT_TIMEOUT=3
MAX_RETRIES=20
cat /var/lib/vzupgrade/net_list | grep -v "^Bridged\|^Host-Only\|^Network ID" | while read net vtype device; do
hwaddr=`grep $device /var/lib/vzupgrade/iflist | awk '{print $5}' `
echo "Trying to restore network: $net ($vtype : $device : $hwaddr)" | tee -a /var/log/vzupgrade.log
# Just process all interfaces with given HWaddr
grep $hwaddr /var/lib/vzupgrade/iflist | cut -f1 -d\ | while read realdev; do
retry=0
while [[ $retry < $MAX_RETRIES ]]; do
sleep $WAIT_TIMEOUT
prlsrvctl net add $net -i $realdev -t $vtype 2>&1 | tee -a /var/log/vzupgrade.log
if [ ${PIPESTATUS[0]} != 253 ]; then
break
fi
echo "Waiting for prl-disp..." | tee -a /var/log/vzupgrade.log
(( retry=$retry+1 ))
done
done
done
# Post-processing of VEs
/var/lib/vzupgrade/vzupgrade-post-ves