home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / rescue / etc / profile.d / profile.sh < prev    next >
Text File  |  2006-11-29  |  3KB  |  128 lines

  1. #
  2. # profile.sh:         Set interactive profile environment
  3. #
  4. # Used configuration files:
  5. #
  6. #     /etc/sysconfig/windowmanager
  7. #     /etc/sysconfig/suseconfig
  8. #     /etc/sysconfig/mail
  9. #     /etc/sysconfig/proxy
  10. #     /etc/sysconfig/console
  11. #     /etc/sysconfig/news
  12. #
  13.  
  14. for sys in /etc/sysconfig/windowmanager    \
  15.        /etc/sysconfig/suseconfig    \
  16.        /etc/sysconfig/mail        \
  17.        /etc/sysconfig/proxy        \
  18.        /etc/sysconfig/console    \
  19.        /etc/sysconfig/news
  20. do
  21.     test -s $sys || continue
  22.     while read line ; do
  23.     case "$line" in
  24.     \#*|"") continue ;;
  25.         esac
  26.     eval val=${line#*=}
  27.     case "$line" in
  28.     CWD_IN_ROOT_PATH=*)
  29.         test "$val" = "yes" || continue
  30.         test $UID -lt 100 && PATH=$PATH:.
  31.         ;;
  32.     CWD_IN_USER_PATH=*)
  33.         test "$val" = "yes" || continue
  34.         test $UID -ge 100 && PATH=$PATH:.
  35.         ;;
  36.     FROM_HEADER=*)
  37.         FROM_HEADER="${val}"
  38.         export FROM_HEADER
  39.         ;;
  40.     SCANNER_TYPE=*)
  41.         SCANNER_TYPE="${val}"
  42.         export SCANNER_TYPE
  43.         ;;
  44.     PROXY_ENABLED=*)
  45.         PROXY_ENABLED="${val}"
  46.         ;;
  47.     HTTP_PROXY=*)
  48.         test -n "$val" || continue
  49.         http_proxy="${val}"
  50.         export http_proxy
  51.         ;;
  52.     HTTPS_PROXY=*)
  53.         test -n "$val" || continue
  54.         https_proxy="${val}"
  55.         export https_proxy
  56.         ;;
  57.     FTP_PROXY=*)
  58.         test -n "$val" || continue
  59.         ftp_proxy="${val}"
  60.         export ftp_proxy
  61.         ;;
  62.     GOPHER_PROXY=*)
  63.         test -n "$val" || continue
  64.         gopher_proxy="${val}"
  65.         export gopher_proxy
  66.         ;;
  67.     NO_PROXY=*)
  68.         test -n "$val" || continue
  69.         no_proxy="${val}"
  70.         export no_proxy
  71.         ;;
  72.     DEFAULT_WM=*)
  73.         DEFAULT_WM="${val}"
  74.         ;;
  75.     CONSOLE_MAGIC=*)
  76.         CONSOLE_MAGIC="${val}"
  77.         ;;
  78.     ORGANIZATION=*)
  79.         test -n "$val" || continue
  80.         ORGANIZATION="${val}"
  81.         export ORGANIZATION
  82.         ;;
  83.     NNTPSERVER=*)
  84.         NNTPSERVER="${val}"
  85.         test -z "$NNTPSERVER" && NNTPSERVER=news
  86.         export NNTPSERVER
  87.     esac
  88.     done < $sys
  89. done
  90. unset sys line val
  91.  
  92. if test -d /usr/lib/dvgt_help ; then
  93.     DV_IMMED_HELP=/usr/lib/dvgt_help
  94.     export DV_IMMED_HELP
  95. fi
  96.  
  97. if test -d /usr/lib/rasmol ; then
  98.     RASMOLPATH=/usr/lib/rasmol
  99.     export RASMOLPATH
  100. fi
  101.  
  102. if test "$PROXY_ENABLED" != "yes" ; then
  103.     unset http_proxy https_proxy ftp_proxy gopher_proxy no_proxy
  104. fi
  105. unset PROXY_ENABLED
  106.  
  107. if test -n "$DEFAULT_WM" -a -z "$WINDOWMANAGER" ; then
  108.     SAVEPATH=$PATH
  109.     PATH=$PATH:/usr/X11R6/bin:/opt/gnome/bin:/usr/openwin/bin
  110.     WINDOWMANAGER="`type -p ${DEFAULT_WM##*/}`"
  111.     PATH=$SAVEPATH
  112.     export WINDOWMANAGER
  113.     unset SAVEPATH
  114. fi
  115. unset DEFAULT_WM
  116.  
  117. if test -n "$CONSOLE_MAGIC" ; then
  118.     case "$(tty 2> /dev/null)" in
  119.     /dev/tty*)
  120.     if test "$TERM" = "linux" -a -t ; then
  121.         # Use /bin/echo due ksh can not do that
  122.         /bin/echo -en "\033$CONSOLE_MAGIC"
  123.     fi
  124.     esac
  125. fi
  126. #
  127. # end of profile.sh
  128.