Replace 'modprobe -l' command with modinfo(8) command line
[grml-autoconfig.git] / autoconfig.functions
index 035803d..012cdf8 100755 (executable)
@@ -384,9 +384,8 @@ config_hostname(){
   fi
 
   einfo "Setting hostname to $HOSTNAME as requested."
-  grml-hostname $HOSTNAME >>$DEBUG ; eend $RC
-  eend $RC
-fi
+  grml-hostname $HOSTNAME >>$DEBUG
+  eend $?
 }
 # }}}
 
@@ -2150,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
@@ -2198,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