ACC SHELL

Path : /etc/init.d/
File Upload :
Current File : //etc/init.d/boot.localnet

#! /bin/sh
#
# Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# /etc/init.d/boot.localnet
#
### BEGIN INIT INFO
# Provides:          boot.localnet
# Required-Start:    boot.rootfsck
# Required-Stop:     $null
# Default-Start:     B
# Default-Stop:
# Short-Description: setup hostname and yp
# Description:       setup hostname and yp
### END INIT INFO

. /etc/rc.status
. /etc/sysconfig/cron

rc_reset

case "$1" in
  start)
	# clean up old yp bindings
	rm -f /var/yp/binding/*.[12]
	
	#
	# set hostname and domainname
	#
	XHOSTNAME=""
	test -f /etc/HOSTNAME && {
	    XHOSTNAME=`cat /etc/HOSTNAME`
	}
	test -n "$HOSTNAME" -a "$HOSTNAME" != '(none)' && {
	    echo Using boot-specified hostname \'${HOSTNAME}\'
	    XHOSTNAME="$HOSTNAME"
	}
	test -n "$XHOSTNAME" && {
	    echo -n Setting up hostname \'${XHOSTNAME%%.*}\'
	    hostname ${XHOSTNAME%%.*}
	    rc_status -v -r
	}
	
	XDOMAINNAME=""
	test -f /etc/defaultdomain && {
	    XDOMAINNAME=`cat /etc/defaultdomain`
	}
        test -n "$XDOMAINNAME" && {
	    echo -n Setting up NIS domainname \'$XDOMAINNAME\'
        }
	domainname "$XDOMAINNAME"
        test -n "$XDOMAINNAME" && {
	rc_status -v -r
        }
	
	unset XHOSTNAME
	unset XDOMAINNAME

	test -x /sbin/ifup -a -f /etc/sysconfig/network/ifcfg-lo && {
	    echo -n "Setting up loopback interface "
	    /sbin/ifup lo -o rc manual
            rc_status -v -r
	}
	;;
    stop|restart)
        # skip / nothing to do
	;;
    status)
	# assume we have been run
	rc_reset
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
	;;
esac

rc_exit
	

ACC SHELL 2018