90-update-alternatives: activate wm-ng only if it is registered as x-window-manager
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 90-update-alternatives
index 234e56a..67f0998 100755 (executable)
@@ -51,7 +51,10 @@ if [ -r $target/usr/bin/w3m ] ; then
 fi
 
 if [ -r $target/usr/bin/wm-ng ] ; then
-   $ROOTCMD update-alternatives --set x-window-manager /usr/bin/wm-ng
+   # activate wm-ng only if it is registered as x-window-manager:
+   if update-alternatives --list x-window-manager | grep -q wm-ng ; then
+     $ROOTCMD update-alternatives --set x-window-manager /usr/bin/wm-ng
+   fi
 fi
 
 ## END OF FILE #################################################################