diff options
author | Christian Rößler | 2014-06-30 18:39:56 +0200 |
---|---|---|
committer | Christian Rößler | 2014-06-30 18:39:56 +0200 |
commit | 088fd8ff43b2463ea93fa26a37806ae734c592fa (patch) | |
tree | dcd697794170e76dd6e6cc5f810cb8905063adbb /satellit_installer/includes/30-setup_dhcp.inc | |
parent | [SSPS] Renaming of includes (.inc extension obligatory) (diff) | |
download | setup-scripts-088fd8ff43b2463ea93fa26a37806ae734c592fa.tar.gz setup-scripts-088fd8ff43b2463ea93fa26a37806ae734c592fa.tar.xz setup-scripts-088fd8ff43b2463ea93fa26a37806ae734c592fa.zip |
[SSPS] Some more bigfixes; better output, better checks for dhclient/pump.
Diffstat (limited to 'satellit_installer/includes/30-setup_dhcp.inc')
-rw-r--r-- | satellit_installer/includes/30-setup_dhcp.inc | 69 |
1 files changed, 49 insertions, 20 deletions
diff --git a/satellit_installer/includes/30-setup_dhcp.inc b/satellit_installer/includes/30-setup_dhcp.inc index 0d13705..14e2d54 100644 --- a/satellit_installer/includes/30-setup_dhcp.inc +++ b/satellit_installer/includes/30-setup_dhcp.inc @@ -1,31 +1,60 @@ -setup_dhcp() { - # First: let's see whether the package isc-dhcp-client is installed - # (we do not like it due to udp checksum failures using virtIO) - echo "# Checking dhcp configuration / utilities..." - if [ $(which dhclient) ]; then - echo -n "# dhclient detected. Uninstalling package isc-dhcp-client..." - dpkg --purge isc-dhcp-client - ERR=$? - if [ "$ERR" -ne 0 ]; then - echo - echo "# WARNING: Could not uninstall isc-dhcp-client (dhclient)!" - echo "# Trying to install pump anyway, but make sure" - echo "# pump is functional!" - else - echo " ok." - fi +install_dhclient() { + echo -n "# Installing dhclient (isc-dhclient)..." + apt-get install isc-dhcp-client 2>/dev/null 1>&2 + if [ "$ERR" -ne 0 ]; then + echo + echo "# WARNING: Could not re-install dhclient (isc-dhcp-client)!" + echo "# This should not happen. I give up." + echo "# Please keep in mind this problem has to be solved" + echo "# before the next boot, as the server will most likely" + echo "# not receive an IP (if not set statically)." + else + echo " ok." fi +} +install_pump() { if [ ! $(which pump) ]; then echo -n "# Installing pump..." - apt-get install pump + apt-get install pump 2>/dev/null 1>&2 if [ "$ERR" -ne 0 ]; then echo - echo "# WARNING: Could install isc-dhcp-client (dhclient)!" - echo "# Trying to install pump anyway, but make sure" - echo "# pump is functional!" + echo "# WARNING: Could not install pump! This is a problem, as pump" + echo "# is an essential package. The server install will" + echo "# continue, but keep in mind this problem has to be" + echo "# solved before the server will work correctly." + echo "# Now re-installing dhclient (isc-dhcp-client)..." + install_dhclient else echo " ok." fi fi } + +uninstall_dhclient() { + echo -n "# Uninstalling dhclient (isc-dhclient)..." + dpkg --remove isc-dhcp-client 2>/dev/null 1>&2 + if [ "$ERR" -ne 0 ]; then + echo + echo "# WARNING: Could not uninstall dhclient (isc-dhcp-client)!" + echo "# This should not happen. I give up." + echo "# Please keep in mind this problem has to be solved" + echo "# before the next boot, as the server will most likely" + echo "# not receive an IP (if not set statically)." + echo "# pump will be installed anyway, but keep an eye on possible problems." + else + echo " ok." + fi +} + +setup_dhcp() { + echo "#" + echo "# First: let's see whether the package isc-dhcp-client is installed," + echo "# as we do not like it due to udp checksum failures using virtIO." + echo "# Checking dhcp configuration / utilities..." + if [ $(which dhclient) ]; then + echo "# dhclient detected. dhclient will be uninstalled due to virtIO-problems." + uninstall_dhclient + fi + install_pump +} |