X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=012cdf80ffba8c46da84522a2450a4700e443057;hp=8eba8601ae74eeab59a9fb7c19398a50277b66e1;hb=ac9110545523883e7ee1e94d21f3d2e8a5390e61;hpb=00cfb15b47dfb930e16335750f9171cb1bd8739f diff --git a/autoconfig.functions b/autoconfig.functions index 8eba860..012cdf8 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -372,20 +372,20 @@ config_language(){ # {{{ Set hostname config_hostname(){ - if checkbootparam 'hostname' ; then + if ! checkbootparam 'hostname' ; then + return 0 + fi + HOSTNAME="$(getbootparam 'hostname' 2>>$DEBUG)" if [ -z "$HOSTNAME" ] && [ -x /usr/bin/random-hostname ] ; then - einfo "Generating random hostname as no hostname was specified." - HOSTNAME="$(/usr/bin/random-hostname)" - eend $? + einfo "Generating random hostname as no hostname was specified." + HOSTNAME="$(/usr/bin/random-hostname)" + eend $? fi + einfo "Setting hostname to $HOSTNAME as requested." - grml-hostname $HOSTNAME >>$DEBUG ; RC=$? - [ "$RC" = "0" ] && hostname $HOSTNAME - eend $RC - else - hostname --file /etc/hostname - fi + grml-hostname $HOSTNAME >>$DEBUG + eend $? } # }}} @@ -2149,7 +2149,7 @@ fi # checkbootparam "BOOT_IMAGE=debian2hd config_virtualbox_shared_folders() { if [ -r /proc/acpi/battery/BAT0/info ] && grep -q 'OEM info:.*innotek' /proc/acpi/battery/BAT0/info ; then einfo "VirtualBox detected, trying to set up Shared Folders." - if ! modprobe -l | grep -q vboxsf.ko ; then + if ! modinfo vboxsf &>/dev/null ; then ewarn "vboxsf driver not present, not setting up VirtualBox Shared Folders." eend 0 elif ! [ -x /usr/sbin/VBoxService ] ; then @@ -2197,4 +2197,4 @@ fi # }}} ## END OF FILE ################################################################# -# vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3 +# vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=2