@@ -341,7 +341,6 @@ function advanced_settings() {
341341 fi
342342}
343343
344-
345344vm_preflight
346345vm_start_script " Use Default Settings?\n\nDefaults:\n• 1 CPU Core\n• 256 MB RAM\n• 1 GB Disk" 13 58
347346post_to_api_vm
@@ -388,29 +387,24 @@ if [[ -z "$DISK_REF" ]]; then
388387 exit 226
389388fi
390389
391- qm set $VMID \
390+ $STD qm set $VMID \
392391 -scsi0 ${DISK_REF} \
393392 -boot order=scsi0 \
394- -tags community-script > /dev/null
393+ -tags community-script
395394msg_ok " Attached disk"
396395
397396msg_info " Resizing disk to ${DISK_SIZE} "
398397qm disk resize " $VMID " scsi0 " ${DISK_SIZE} " > /dev/null
399398msg_ok " Resized disk to ${DISK_SIZE} "
400399
401400set_description
402-
403401msg_ok " Created OpenWrt VM ${CL}${BL} (${HN} )"
404402
405- # Started here whatever START_VM says: the network has to be configured from
406- # inside the guest before the VM is any use.
407403msg_info " Booting OpenWrt to configure its network interfaces"
408404$STD qm start $VMID
409405sleep 15
410406VM_STATE=" "
411407for i in {1..30}; do
412- # A missing config means the VM is gone, not slow. Waiting out the other 29
413- # tries only bought 29 more copies of the same error.
414408 if ! VM_STATE=" $( qm status " $VMID " 2>&1 ) " ; then
415409 msg_error " VM $VMID no longer exists: ${VM_STATE} "
416410 exit 226
@@ -427,19 +421,19 @@ sleep 5
427421msg_ok " OpenWrt is running"
428422
429423msg_info " Configuring network interfaces in OpenWrt"
430- send_line_to_vm " "
431- send_line_to_vm " uci delete network.@device[0]"
432- send_line_to_vm " uci set network.wan=interface"
433- send_line_to_vm " uci set network.wan.device=eth1"
434- send_line_to_vm " uci set network.wan.proto=dhcp"
435- send_line_to_vm " uci delete network.lan"
436- send_line_to_vm " uci set network.lan=interface"
437- send_line_to_vm " uci set network.lan.device=eth0"
438- send_line_to_vm " uci set network.lan.proto=static"
439- send_line_to_vm " uci set network.lan.ipaddr=${LAN_IP_ADDR} "
440- send_line_to_vm " uci set network.lan.netmask=${LAN_NETMASK} "
441- send_line_to_vm " uci commit"
442- send_line_to_vm " poweroff"
424+ $STD send_line_to_vm " "
425+ $STD send_line_to_vm " uci delete network.@device[0]"
426+ $STD send_line_to_vm " uci set network.wan=interface"
427+ $STD send_line_to_vm " uci set network.wan.device=eth1"
428+ $STD send_line_to_vm " uci set network.wan.proto=dhcp"
429+ $STD send_line_to_vm " uci delete network.lan"
430+ $STD send_line_to_vm " uci set network.lan=interface"
431+ $STD send_line_to_vm " uci set network.lan.device=eth0"
432+ $STD send_line_to_vm " uci set network.lan.proto=static"
433+ $STD send_line_to_vm " uci set network.lan.ipaddr=${LAN_IP_ADDR} "
434+ $STD send_line_to_vm " uci set network.lan.netmask=${LAN_NETMASK} "
435+ $STD send_line_to_vm " uci commit"
436+ $STD send_line_to_vm " poweroff"
443437msg_ok " Network interfaces configured in OpenWrt"
444438
445439msg_info " Waiting for OpenWrt to shut down"
0 commit comments