# SliTaz package receipt. PACKED_SIZE="16.0K" UNPACKED_SIZE="32.0K" PACKAGE="lan-config" VERSION="1.0" CATEGORY="network" SHORT_DESC="Tiny SliTaz lan ip configuration (2nd ethernet card)" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" WEB_SITE="http://tiny.slitaz.org/" WANTED="base-tiny" CONFIG_FILES="/etc/network.conf" DEPENDS="busybox-net" # Rules to configure and make the package. compile_rules() { mkdir -p $stuff/etc/init.d 2> /dev/null cp $wanted_stuff/etc/init.d/network.sh $stuff/etc/init.d/ cp $wanted_stuff/etc/network.conf $stuff/etc/ sed -i -e 's#^dhcp(.*#&\ if [ "$LAN_DHCP" = "yes" ] ; then\ echo "Starting udhcpc client on: $LAN_INTERFACE..."\ udhcpc -b -T 1 -A 12 -i $LAN_INTERFACE -p /var/run/udhcpc.$LAN_INTERFACE.pid\ fi#' -e 's#^static_ip(.*#&\ if [ "$LAN_STATIC" = "yes" ] ; then\ echo "Configuring static IP on $LAN_INTERFACE: $LAN_IP..."\ ifconfig $LAN_INTERFACE $LAN_IP netmask $LAN_NETMASK up\ fi#' $stuff/etc/init.d/network.sh cat >> $stuff/etc/network.conf < LAN Interface LAN Network configuration LAN Internet address LAN Netmask Enable LAN routing
EOT } post_install() { DHCP="no" STATIC="yes" case "$MODE" in "") return 1;; DHCP) DHCP="yes" STATIC="no" esac sed -i -e "s/^LAN_INTERFACE=.*/LAN_INTERFACE=\"$INTERFACE\"/" \ -e "s/^LAN_NETMASK=.*/LAN_NETMASK=\"$NETMASK\"/" \ -e "s/^LAN_STATIC=.*/LAN_STATIC=\"$STATIC\"/" \ -e "s/^LAN_DHCP=.*/LAN_DHCP=\"$DHCP\"/" \ -e "s/^LAN_IP=.*/LAN_IP=\"$IP\"/" $1/etc/network.conf [ "$ROUTING" = "ON" ] && cat >> $1/etc/init.d/local.sh < /proc/sys/net/ipv4/ip_forward EOT }