From a773203b1392319407e9e757b74519a2ba065f94 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 22 Mar 2026 12:03:27 +0400 Subject: [PATCH] test container creation --- .../miaou/miaou-migrate-sympa-from-container | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sympa/miaou/miaou-migrate-sympa-from-container b/sympa/miaou/miaou-migrate-sympa-from-container index 7db8569..b6c5e86 100755 --- a/sympa/miaou/miaou-migrate-sympa-from-container +++ b/sympa/miaou/miaou-migrate-sympa-from-container @@ -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 +function create_new_container { + 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