--- trunk/busybox-initscripts/rc/network 2008/06/02 22:14:35 724 +++ trunk/busybox-initscripts/rc/network 2010/12/15 17:44:36 1168 @@ -74,7 +74,7 @@ { if [[ -z ${NETWORKING} ]] then - echo "NETWORKING missing in net.${interface}, aborted" + rc_echo "NETWORKING missing in net.${interface}, aborted" exit 1 fi @@ -82,28 +82,28 @@ static) if [[ -z ${IP} ]] then - echo "IP missing in net.${interface}, aborted" + rc_echo "IP missing in net.${interface}, aborted" exit 1 fi if [[ -z ${NETMASK} ]] then - echo -n "NETMASK missing in net.${interface}, " - echo "using 255.255.255.0" + rc_echo -n "NETMASK missing in net.${interface}, " + rc_echo "using 255.255.255.0" NETMASK=255.255.255.0 fi if [[ -z ${BROADCAST} ]] then - echo -n "BROADCAST missing in net.${interface}, " - echo "using default address" + rc_echo -n "BROADCAST missing in net.${interface}, " + rc_echo "using default address" fi ;; dhcp) if [[ -z ${DHCP_PROG} ]] then - echo "DHCP_PROG missing in net.${interface}, aborted" + rc_echo "DHCP_PROG missing in net.${interface}, aborted" exit 1 fi ;; @@ -142,13 +142,13 @@ if [[ -z ${iface} ]] then - echo "WEP: no \$iface given. Aborting setup." + rc_echo "WEP: no \$iface given. Aborting setup." return 1 fi ${CURS_UP} ${SET_WWCOL} - echo "[AUTH: WEP]" + rc_echo "[AUTH: WEP]" iwconfig "${iface}" enc on [[ -n ${WIRELESS_KEY_LENGTH} ]] && iwconfig "${iface}" enc "${WIRELESS_KEY_LENGTH}" @@ -162,19 +162,19 @@ if [[ -z ${iface} ]] then - echo "WPA: no \$iface given. Aborting setup." + rc_echo "WPA: no \$iface given. Aborting setup." return 1 fi if [ ! -x /sbin/wpa_supplicant ] then - echo "WPA: wpa_supplicant not installed. Aborting setup." + rc_echo "WPA: wpa_supplicant not installed. Aborting setup." return 1 fi ${CURS_UP} ${SET_WWCOL} - echo "[AUTH: WPA]" + rc_echo "[AUTH: WPA]" # get default settings [[ -f /etc/conf.d/wpa_supplicant ]] && source /etc/conf.d/wpa_supplicant @@ -184,7 +184,7 @@ [[ -z ${WIRELESS_WPA_SKEL} ]] && WIRELESS_WPA_SKEL=/etc/conf.d/wpa_supplicant.skel if [[ -z ${WIRELESS_WPA_DRIVER} ]] then - echo "WPA: WIRELESS_WPA_DRIVER given. Aborting setup." + rc_echo "WPA: WIRELESS_WPA_DRIVER given. Aborting setup." return 1 fi @@ -212,7 +212,7 @@ ${WIRELESS_WPA_OPTS} # echo wait 5 seconds - echo " Waiting 5 seconds to retrieve authentification reply ... " + rc_echo " Waiting 5 seconds to retrieve authentification reply ... " sleep 5 } @@ -222,7 +222,7 @@ if [[ -z ${iface} ]] then - echo "WIRELESS_EXTENSIONS: no \$iface given. Aborting setup." + rc_echo "WIRELESS_EXTENSIONS: no \$iface given. Aborting setup." return 1 fi @@ -234,7 +234,7 @@ [[ -n ${WIRELESS_NICK} ]] || [[ -n ${WIRELESS_AUTH_MODE} ]] then - echo -e ${COLOREDSTAR}"Setting up wlan-ext for ${COLBLUE}${iface}${COLDEFAULT} ... " + rc_print "Setting up wlan-ext for ${COLBLUE}${iface}${COLDEFAULT} ... " fi [[ -n ${WIRELESS_BITRATE} ]] && iwconfig "${iface}" rate "${WIRELESS_BITRATE}" @@ -259,27 +259,27 @@ if [[ -z ${iface} ]] then - echo "BRIDGE: no \$iface given. Aborting setup." + rc_echo "BRIDGE: no \$iface given. Aborting setup." return 1 fi if [[ -z ${method} ]] then - echo "BRIDGE: no \$method given. Aborting setup." + rc_echo "BRIDGE: no \$method given. Aborting setup." return 1 fi # first check for brctl if [[ -z $(which brctl) ]] then - echo "brctl not found! Please install 'net-misc/bridge-utils'." + rc_echo "brctl not found! Please install 'net-misc/bridge-utils'." return 1 fi # check the config if [[ -z ${BRIDGE_INTERFACES} ]] then - echo "BRIDGE: no \$BRIDGE_INTERFACES given. Aborting setup." + rc_echo "BRIDGE: no \$BRIDGE_INTERFACES given. Aborting setup." return 1 fi @@ -297,7 +297,7 @@ # enable spanning-tree protocol case ${BRIDGE_STP} in on|off) brctl stp ${iface} ${BRIDGE_STP} ;; - *) echo "BRIDGE: unkown value \$BRIDGE_STP='$BRIDGE_STP'."; return 1 ;; + *) rc_echo "BRIDGE: unkown value \$BRIDGE_STP='$BRIDGE_STP'."; return 1 ;; esac ;; @@ -329,7 +329,7 @@ add) message="Adding route ${COLBLUE}${route}${COLDEFAULT} ..." ;; del) message="Removing route ${COLBLUE}${route}${COLDEFAULT} ..." ;; *) - echo "config_routes: unsupported \$method '${method}'." + rc_echo "config_routes: unsupported \$method '${method}'." exit 1 ;; esac @@ -343,7 +343,7 @@ case "${route}" in \#*|"") continue ;; esac - echo -e ${COLOREDSTAR}"${message}" + rc_print "${message}" route ${method} ${route} evaluate_retval done @@ -363,7 +363,7 @@ ALL_INTERFACES="$1" else ${FAILURE} - echo "Interface $1 does not exist. Aborting" + rc_echo "Interface $1 does not exist. Aborting" ${NORMAL} exit 1 fi @@ -379,7 +379,7 @@ # setup mac if [ -n "${FORCE_MAC_TO}" ] then - echo -e ${COLOREDSTAR}"Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... " + rc_print "Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... " ifconfig "${iface}" hw ether "${FORCE_MAC_TO}" evaluate_retval fi @@ -396,20 +396,20 @@ # now configure wireless_extensions [ -x /usr/sbin/iwconfig ] && setup_wireless_extensions "${iface}" - echo -e ${COLOREDSTAR}"Bringing up interface ${COLBLUE}${iface}${COLDEFAULT} ..." + rc_print "Bringing up interface ${COLBLUE}${iface}${COLDEFAULT} ..." # setup static or dhcp case ${NETWORKING} in dhcp|DHCP) ${CURS_UP} ${SET_WWCOL} - echo "[DHCP]" + rc_echo "[DHCP]" loadproc ${DHCP_PROG} ${DHCP_START} "${iface}" ;; static|STATIC) ${CURS_UP} ${SET_WWCOL} - echo "[STATIC]" + rc_echo "[STATIC]" ifconfig "${iface}" "${IP}" netmask "${NETMASK}" broadcast "${BROADCAST}" evaluate_retval ;; @@ -418,7 +418,7 @@ # setup def gw if [[ -n ${GATEWAY} ]] then - echo -e ${COLOREDSTAR}"Setting up default gateway for ${COLBLUE}${iface}${COLDEFAULT} ..." + rc_print "Setting up default gateway for ${COLBLUE}${iface}${COLDEFAULT} ..." route add default gateway ${GATEWAY} metric 1 dev ${iface} evaluate_retval @@ -428,8 +428,8 @@ # setup /etc/resolv.conf if [[ -n ${NAMESERVER} ]] then - echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..." - + rc_print "Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..." + # whipe out the old one echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf for dns in ${NAMESERVER} @@ -456,7 +456,7 @@ ALL_INTERFACES="$1" else ${FAILURE} - echo "Interface $1 does not exist. Aborting" + rc_echo "Interface $1 does not exist. Aborting" ${NORMAL} exit 1 fi @@ -470,12 +470,12 @@ if [[ -n ${GATEWAY} ]] then - echo -e ${COLOREDSTAR}"Removing default gateway ..." + rc_print "Removing default gateway ..." route del -net default evaluate_retval fi - echo -e ${COLOREDSTAR}"Bringing down interface ${COLBLUE}${iface}${COLDEFAULT} ..." + rc_print "Bringing down interface ${COLBLUE}${iface}${COLDEFAULT} ..." ifconfig ${iface} down evaluate_retval @@ -488,10 +488,10 @@ # shutdown dhcp-daemon if [[ ${NETWORKING} = dhcp ]] && [[ -n $(pidof ${DHCP_PROG}) ]] then - echo -e ${COLOREDSTAR}"Stopping the dhcp-daemon ..." + rc_print "Stopping the dhcp-daemon ..." ${CURS_UP} ${SET_WWCOL} - echo "[$(basename ${DHCP_PROG})]" + rc_echo "[$(basename ${DHCP_PROG})]" ${DHCP_PROG} ${DHCP_STOP} "${iface}" evaluate_retval fi