######################################################
#
# BYLD: Build Your Linux Disk
# License: GPL2 (see LICENSE)
#
# (C) 1999-2000, Erich Roncarolo <erich@roncarolo.eu.org>
#

######################################################
#
# This is the Buildfile for the 'NetBase' package.
#

function bf_log { echo "$@" >> $RLOG ; }

bf_log "--- NetBase Package Buildfile ---"

######################
#
# Needed binaries
#

# This command look for a file list and put it in directory sbin
bf_log "source Take root.root sbin ifconfig route"
source Take root.root sbin ifconfig route

# This command look for a file list and put it in directory opt/sbin
bf_log "source Take root.root opt/sbin netconfig"
source Take root.root opt/sbin netconfig

######################
#
# Needed config
#

# This command look for a file list and put it in directory bin
bf_log "source Take root.root etc services"
source Take root.root etc services

##############
#
# RCs
#

test -f etc/rc.d/.rcs && KC=$(grep netconfig etc/rc.d/.rcs)
if [ -z "$KC" ] ; then
	echo "" >> etc/rc.d/.rcs
	echo "# Network base configuration" >> etc/rc.d/.rcs
	echo "netconfig" >> etc/rc.d/.rcs
fi
bf_log "NetBase RCs"
bf_log $(cat etc/rc.d/.rcs)

##############
#
# Profiles
#

source Take root.root etc/profile.d/ profile.netbase
test -f etc/profile.d/.profiles && PNB=$(grep profile.netbase etc/profile.d/.profiles)
if [ -z "$PNB" ] ; then
	echo "" >> etc/profile.d/.profiles
	echo "# NetBase profile" >> etc/profile.d/.profiles
	echo "profile.netbase" >> etc/profile.d/.profiles
fi
chown 0.0 etc/profile.d/.profiles
bf_log "NetBase .profiles"
bf_log $(cat etc/profile.d/.profiles)

