#!/bin/bash # ======================================================= # # preinst script for dhcp-vars cpkg (Mon, 18 Jun 2007) # # # # Based on 000-srv-vars llxcfg-script: # # # # Escrito por Fco Javier Lopez Perez # # para LliureX. Junio 2007 # # # # Genera variables necesarias del dhcp # # ======================================================= # # set -e # main [ "$1" = "pre-cpkg" ] || exit 0 # libreria LIB_FILE="/usr/share/lliurex/lliurex-srv-common/lliurex-netfuncs.sh" [ -e "$LIB_FILE" ] || exit 1 . $LIB_FILE DHCP_RANGE="`get_dhcp_range`" DHCP_FIRST_IP="${DHCP_RANGE%%[[:space:]]*}" DHCP_LAST_IP="${DHCP_RANGE##*[[:space:]]}" # create vars llxcfg-systemvars add "DHCP_FIRST_IP=$DHCP_FIRST_IP" \ "DHCP_LAST_IP=$DHCP_LAST_IP" exit 0