diff options
author | Simon Rettberg | 2023-06-06 16:47:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-06-06 16:47:00 +0200 |
commit | f17b902a16d9ee169be8eda7d4fba85658a958e2 (patch) | |
tree | 86e1fb5c65bdbdee2d7c45b00669dbddb65deb03 /core/modules/run-virt/data/opt/openslx | |
parent | [remote-access/tigervnc] tigervncpasswd (diff) | |
download | mltk-f17b902a16d9ee169be8eda7d4fba85658a958e2.tar.gz mltk-f17b902a16d9ee169be8eda7d4fba85658a958e2.tar.xz mltk-f17b902a16d9ee169be8eda7d4fba85658a958e2.zip |
[run-virt] Don't run DHCPd config generator/restarter unless we support running VMs at all
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx')
-rwxr-xr-x | core/modules/run-virt/data/opt/openslx/scripts/runvirt-start_dhcpd | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/scripts/runvirt-start_dhcpd b/core/modules/run-virt/data/opt/openslx/scripts/runvirt-start_dhcpd index 60cf7333..99320dd6 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/runvirt-start_dhcpd +++ b/core/modules/run-virt/data/opt/openslx/scripts/runvirt-start_dhcpd @@ -1,5 +1,8 @@ #!/bin/bash +# If this doesn't exist, we don't support running VMs, so this is pointless +[ -s /opt/openslx/vmchooser/config/virtualization.conf ] || exit 0 + . /opt/openslx/config . /opt/openslx/vmchooser/config/virtualization.conf @@ -59,8 +62,9 @@ elif [ -s "${DHCP_NAT_CONF}" ] && [ "${DHCP_NAT_CONF}.$$" -ot "${DHCP_NAT_CONF}" rm -f -- "${DHCP_NAT_CONF}.$$" else # Changed, replace and restart - mv -f -- "${DHCP_NAT_CONF}.$$" "${DHCP_NAT_CONF}" echo "NAT1 dhcpd config changed; restarting service..." + diff -u "${DHCP_NAT_CONF}" "${DHCP_NAT_CONF}.$$" + mv -f -- "${DHCP_NAT_CONF}.$$" "${DHCP_NAT_CONF}" systemctl --no-block try-restart run-virt-dhcpd.service fi |