|
|
|
@ -69,14 +69,20 @@ function get_container_net0 { |
|
|
|
|
|
|
|
function stop_old_container { |
|
|
|
pct-stop $CONTAINER |
|
|
|
pct-rename $CONTAINER $CONTAINER.OLD |
|
|
|
pct-rename $CONTAINER $CONTAINER.9 |
|
|
|
} |
|
|
|
|
|
|
|
function create_new_container { |
|
|
|
# miaou-create $CONTAINER |
|
|
|
# pct-stop $CONTAINER |
|
|
|
local net1="net1: $(get_container_net0 | cut -d' ' -f2)" |
|
|
|
echo $net1 |
|
|
|
miaou-create $CONTAINER |
|
|
|
|
|
|
|
local vmid=$(pct-lookup $CONTAINER) |
|
|
|
local vm_conf_file="/etc/pve/nodes/$(hostname)/lxc/$vmid.conf" |
|
|
|
local net1="net1: $(grep ^net0 $vm_conf_file | cut -d' ' -f2 | sed 's/name=eth0/name=eth1/')" |
|
|
|
|
|
|
|
pct stop $vmid |
|
|
|
/opt/miaou-bash/tools/append_or_replace "^net0.*$" "$SYMPA_NET0\n$net1" $vm_conf_file |
|
|
|
pct start $vmid |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# MAIN |
|
|
|
@ -84,13 +90,12 @@ function create_new_container{ |
|
|
|
set -Eue |
|
|
|
parse_options $* |
|
|
|
assert_proxmox |
|
|
|
# assert_container_sympa_debian9 |
|
|
|
# export_sympa |
|
|
|
# get_container_net0 |
|
|
|
# stop_old_container |
|
|
|
assert_container_sympa_debian9 |
|
|
|
export_sympa |
|
|
|
get_container_net0 |
|
|
|
stop_old_container |
|
|
|
create_new_container |
|
|
|
|
|
|
|
# 4. create container with same IP |
|
|
|
# 5. install sympa |
|
|
|
# 6. import old data |
|
|
|
# 7. fix_dmarc_off + fix_dkim_global_on + fix external origin |
|
|
|
|