# HG changeset patch # User Christophe Lincoln # Date 1305499861 -7200 # Node ID 8b16caf41633f0837db33b49e55182a87f2c7ad5 # Parent a0f7424e5486826d3222c60995423034144c0a4e Clean up network.sh and use fgrep when possible in rcS diff -r a0f7424e5486 -r 8b16caf41633 etc/init.d/network.sh --- a/etc/init.d/network.sh Mon May 16 00:32:16 2011 +0200 +++ b/etc/init.d/network.sh Mon May 16 00:51:01 2011 +0200 @@ -10,8 +10,7 @@ . $2 fi - -Boot() { +boot() { # Set hostname. echo -n "Setting hostname..." /bin/hostname -F /etc/hostname @@ -24,17 +23,16 @@ status } - +# Use ethernet eth() { -# Use ethernet - ifconfig $INTERFACE up + ifconfig $INTERFACE up } -wifi() { - # For wifi. Users just have to enable it through yes and usually - # essid any will work and the interface is autodetected. +# For wifi. Users just have to enable it through yes and usually +# essid any will work and the interface is autodetected. +wifi() { if [ "$WIFI" = "yes" ] || grep -q "wifi" /proc/cmdline; then - ifconfig $INTERFACE down + ifconfig $INTERFACE down # Confirm if $WIFI_INTERFACE is the wifi interface if [ ! -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then @@ -52,22 +50,19 @@ iwconfig $WIFI_INTERFACE txpower on fi status - + [ -n "$WPA_DRIVER" ] || WPA_DRIVER="wext" - - IWCONFIG_ARGS="" [ -n "$WIFI_MODE" ] && IWCONFIG_ARGS="$IWCONFIG_ARGS mode $WIFI_MODE" [ -n "$WIFI_CHANNEL" ] && IWCONFIG_ARGS="$IWCONFIG_ARGS channel $WIFI_CHANNEL" # unencrypted network - if [ "$WIFI_KEY" == "" -o "$WIFI_KEY_TYPE" == "none" ]; -then + if [ "$WIFI_KEY" == "" -o "$WIFI_KEY_TYPE" == "none" ]; then iwconfig $WIFI_INTERFACE essid "$WIFI_ESSID" $IWCONFIG_ARGS fi # encrypted network [ -n "$WIFI_KEY" ] && case "$WIFI_KEY_TYPE" in wep|WEP) - IWCONFIG_ARGS="$IWCONFIG_ARGS key $WIFI_KEY" + IWCONFIG_ARGS="$IWCONFIG_ARGS key $WIFI_KEY" iwconfig $WIFI_INTERFACE essid "$WIFI_ESSID" $IWCONFIG_ARGS # wpa_supplicant can also deal with wep encryption but iwconfig is preferred # Tip: Use unquoted strings for hexadecimal key in wep_key0 @@ -87,9 +82,11 @@ #EOF # echo "Starting wpa_supplicant for NONE/WEP..." # wpa_supplicant -B -W -c/tmp/wpa.conf -D$WPA_DRIVER -i$WIFI_INTERFACE - ;; - wpa|WPA) cat /etc/wpa_supplicant.conf > /tmp/wpa.conf # load pre-configured multiple profiles - cat >> /tmp/wpa.conf < /tmp/wpa.conf + cat >> /tmp/wpa.conf < /tmp/wpa.conf cat >> /tmp/wpa.conf <> /etc/fstab diff -r a0f7424e5486 -r 8b16caf41633 etc/init.d/system.sh --- a/etc/init.d/system.sh Mon May 16 00:32:16 2011 +0200 +++ b/etc/init.d/system.sh Mon May 16 00:51:01 2011 +0200 @@ -83,7 +83,7 @@ echo "Checking if /etc/locale.conf exists... " if [ ! -s "/etc/locale.conf" ]; then if [ "$SCREEN" != "text" ] && [ -x /usr/bin/Xorg ]; then - echo "GUI configuration starting..." + echo "Starting TazBox configuration..." DISPLAY=:1 tazbox boot else tazlocale