home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20120521.etc.tar.gz / bradford.20120521.etc.tar / etc / init.d / boot.localnet < prev    next >
Text File  |  2005-01-14  |  1KB  |  76 lines

  1. #! /bin/sh
  2. #
  3. # Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
  4. # All rights reserved.
  5. #
  6. # /etc/init.d/boot.localnet
  7. #
  8. ### BEGIN INIT INFO
  9. # Provides:          boot.localnet
  10. # Required-Start:    boot.cleanup
  11. # Required-Stop:
  12. # Default-Start:     B
  13. # Default-Stop:
  14. # Description:       setup hostname and yp
  15. ### END INIT INFO
  16.  
  17. . /etc/rc.status
  18. . /etc/sysconfig/cron
  19.  
  20. rc_reset
  21.  
  22. case "$1" in
  23.   start)
  24.     # clean up old yp bindings
  25.     rm -f /var/yp/binding/*.[12]
  26.     
  27.     #
  28.     # set hostname and domainname
  29.     #
  30.     XHOSTNAME=""
  31.     test -f /etc/HOSTNAME && {
  32.         XHOSTNAME=`cat /etc/HOSTNAME`
  33.     }
  34.     test -n "$XHOSTNAME" && {
  35.         echo -n Setting up hostname \'${XHOSTNAME%%.*}\'
  36.         hostname ${XHOSTNAME%%.*}
  37.         rc_status -v -r
  38.     }
  39.     
  40.     XDOMAINNAME=""
  41.     test -f /etc/defaultdomain && {
  42.         XDOMAINNAME=`cat /etc/defaultdomain`
  43.     }
  44.         test -n "$XDOMAINNAME" && {
  45.         echo -n Setting up NIS domainname \'$XDOMAINNAME\'
  46.         }
  47.     domainname "$XDOMAINNAME"
  48.         test -n "$XDOMAINNAME" && {
  49.     rc_status -v -r
  50.         }
  51.     
  52.     unset XHOSTNAME
  53.     unset XDOMAINNAME
  54.  
  55.     test -x /sbin/ifup -a -f /etc/sysconfig/network/ifcfg-lo && {
  56.         echo -n "Setting up loopback interface "
  57.         /sbin/ifup lo -o rc manual
  58.             rc_status -v -r
  59.     }
  60.     ;;
  61.     stop|restart)
  62.         # skip / nothing to do
  63.     ;;
  64.     status)
  65.     rc_failed 4
  66.     rc_status -v
  67.     ;;
  68.     *)
  69.     echo "Usage: $0 {start|stop|status|restart}"
  70.     exit 1
  71.     ;;
  72. esac
  73.  
  74. rc_exit
  75.     
  76.