#!/bin/sh

# sources initrd-netboot scripts at boot

# copyright 2005 Vagrant Cascadian <vagrant@freegeek.org>, distributed under
# the terms of the GNU General Public License version 2 or any later version.

for a in initrd-netboot.conf initrd-netboot-tools.conf ; do
  conf="/etc/initrd-netboot/$a"
  if [ -f "$conf" ]; then
    . "$conf"
  else
    echo "WARNING: file not found: $conf"
  fi
done

# set some stupid defaults
test -z "$CONFDIR" && CONFDIR=/etc/initrd-netboot
test -z "$script_dir" && script_dir="$CONFDIR/install_scripts"

# TODO: put this later in the process, after rootdev is determined?
echo "initrd-netboot-tools: $initrd_netboot_version"

if [ ! -d "$script_dir" ]; then
  echo "ERROR: could not find script dir: $script_dir"
  exit 1
fi

# source initrd-netboot scripts
for a in $script_dir/* ; do 
  . $a 
done
