home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd2.bin / suse / inst-sys / lib / YaST2 / bin / yast2 < prev    next >
Encoding:
Text File  |  2000-03-30  |  1.7 KB  |  45 lines

  1. #!/bin/bash
  2. #/----------------------------------------------------------------------\
  3. #|                                                                      |  
  4. #|                      __   __    ____ _____ ____                      |  
  5. #|                      \ \ / /_ _/ ___|_   _|___ \                     |  
  6. #|                       \ V / _` \___ \ | |   __) |                    |  
  7. #|                        | | (_| |___) || |  / __/                     |  
  8. #|                        |_|\__,_|____/ |_| |_____|                    |  
  9. #|                                                                      |  
  10. #|                               core system                            | 
  11. #|                                                        (C) SuSE GmbH |  
  12. #\----------------------------------------------------------------------/ 
  13. #
  14. #   File:       yast2
  15. #
  16. #   Authors:    Mathias Kettner <kettner@suse.de>
  17. #           Klaus Kaempf <kkaempf@suse.de>
  18. #   Maintainer: Klaus Kaempf <kkaempf@suse.de>
  19. #
  20. #
  21. #   This script is called, when the user just types in 'yast2'. It starts
  22. #   the qt user interface in case the DISPLAY variable is set and other-
  23. #   wise the ncurses. It starts then the module 'menu' which implements
  24. #   the configuration and administration menu.
  25. #
  26. #/-*/
  27. if [ $UID == 0 ] ; then
  28.   if [ -z "$DISPLAY" ] ; then
  29.     y2ncurses menu ncurses -T
  30.   else
  31.     y2qt menu qt -T -geometry 640x480 -style=platinum
  32.   fi
  33. else
  34.   if [ -n "$DISPLAY" ] ; then
  35.     xhost +`hostname` > /dev/null 2>&1
  36.   fi
  37.   # su asks "password", this will output "root password"
  38.   echo -n "root "
  39.   if [ -z "$DISPLAY" ] ; then
  40.     su -c 'PATH=/sbin:/usr/sbin:$PATH y2ncurses menu ncurses -T'
  41.   else
  42.     su -c 'PATH=/sbin:/usr/sbin:$PATH y2qt menu qt -T -geometry 640x480 -style=platinum'
  43.   fi
  44. fi
  45.