Results 1 to 5 of 5

Thread: Dual Mode Wan + Lan AZboz HD Script

  1. #1
    V.I.P AJR's Avatar
    Join Date
    Dec 2008
    Posts
    691
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Dual Mode Wan + Lan AZboz HD Script

    With grateful thanks once again to elgeneral for this script by Kameleon74
    Translation by Google

    DualMode -**** LAN + WLAN

    lan_script.sh
    Code:
    #! /bin/sh
    export LD_LIBRARY_PATH=/MMP/lib:/MMP/usr/lib
    export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/MMP/bin:/MMP/sbin:/MMP/usr/bin:/MMP/usr
    /sbin
    
    [ -z "$ACTION" ] && echo "Error: should be called from lan_steup" && exit 1
    
    RESOLV_CONF="/etc/resolv.conf"
    IF_0="eth0"
    IF_1="ra0"
    
    ######################################################
    ### start
    ######################################################
    if [ "$ACTION" = "init" ]; then
    echo "NET_SCRIPT**** load wireless driver rt61!!!"
    killall -9 udh***
    insmod /MMP/modules/2.6.15/rt61.ko
    ifconfig $IF_0 up
    ifconfig $IF_1 up
    fi
    ######################################################
    ### start
    ######################################################
    if [ "$ACTION" = "start" ]; then
    ### MODE: 0=cable
    if [ "$MODE" = "0" ]; then
    echo "NET_SCRIPT**** ethernet cable setting..."
    ifconfig $IF_0 0.0.0.0 &
    sleep 1
    [ ! -z "`/bin/pidof ifconfig`" ] && /usr/bin/killall -9 ifconfig
    ifconfig $IF_1 down
    ifconfig $IF_0 up
    ### IP_DHCP_MODE: 0=dhcp
    if [ "$IP_DHCP_MODE" = "0" ]; then
    echo "NET_SCRIPT**** ethernet dhcp mode!!!"
    fi
    ### IP_DHCP_MODE: 1=static
    if [ "$IP_DHCP_MODE" = "1" ]; then
    ifconfig $IF_0 $IP_ADDR netmask $IP_SUBNET_MASK &
    sleep 2
    if [ ! -z "`/bin/pidof ifconfig`" ] ; then
    /usr/bin/killall -9 ifconfig
    ifconfig $IF_0 $IP_ADDR netmask $IP_SUBNET_MASK &
    sleep 2
    fi
    if [ -n "$IP_GATEWAY" ] ; then
    while route del default gw 0.0.0.0 dev $IF_0 ; do
    :
    done
    for i in $IP_GATEWAY ; do
    route add default gw $i dev $IF_0
    done
    fi
    echo -n > $RESOLV_CONF
    [ -n "$HOST_DOMAIN" ] && echo search $HOST_DOMAIN **** $RESOLV_CONF
    [ -n "$DNS_IP_ADDR1" ] && echo nameserver $DNS_IP_ADDR1 **** $RESOLV_CONF
    [ -n "$DNS_IP_ADDR2" ] && echo nameserver $DNS_IP_ADDR2 **** $RESOLV_CONF
    fi
    echo "NET_SCRIPT**** ethernet cable OK!!!"
    fi
    ### MODE: 1=wireless
    if [ "$MODE" = "1" ]; then
    echo "NET_SCRIPT**** wireless setting..."
    insmod /MMP/modules/2.6.15/rt61.ko
    
    ifconfig $IF_0 0.0.0.0 &
    sleep 1
    [ ! -z "`/bin/pidof ifconfig`" ] && /usr/bin/killall -9 ifconfig
    ifconfig $IF_1 up
    iwconfig $IF_1 mode Managed
    [ -n "$HOSTNAME" ] && iwconfig $IF_1 nick $HOSTNAME
    iwconfig $IF_1 channel auto
    iwconfig $IF_1 rate auto
    iwpriv $IF_1 set NetworkType=Infra
    if [ "$WLAN_ENCYPTION" != "0" ] && [ -n "$WLAN_KEY" ]; then
    iwpriv $IF_1 set AuthMode=WPA2PSK
    iwpriv $IF_1 set EncrypType=TKIP
    iwpriv $IF_1 set WPAPSK="$WLAN_KEY"
    else
    iwpriv $IF_1 set AuthMode=OPEN
    iwpriv $IF_1 set EncrypType=NONE
    fi
    iwpriv $IF_1 set SSID="$WLAN_ESSID"
    
    iwgetid -m $IF_1
    iwgetid -a $IF_1
    iwgetid -c $IF_1
    iwgetid -f $IF_1
    iwgetid -p $IF_1
    iwgetid -r $IF_1
    
    ### IP_DHCP_MODE: 0=dhcp
    if [ "$IP_DHCP_MODE" = "0" ]; then
    echo "NET_SCRIPT**** wireless dhcp mode!!!"
    fi
    ### IP_DHCP_MODE: 1=static
    if [ "$IP_DHCP_MODE" = "1" ]; then
    ifconfig $IF_1 $IP_ADDR netmask $IP_SUBNET_MASK &
    sleep 2
    if [ ! -z "`/bin/pidof ifconfig`" ] ; then
    /usr/bin/killall -9 ifconfig
    ifconfig $IF_1 $IP_ADDR netmask $IP_SUBNET_MASK &
    sleep 2
    fi
    if [ -n "$IP_GATEWAY" ] ; then
    while route del default gw 0.0.0.0 dev $IF_1 ; do
    :
    done
    for i in $IP_GATEWAY ; do
    route add default gw $i dev $IF_1
    done
    fi
    echo -n > $RESOLV_CONF
    [ -n "$HOST_DOMAIN" ] && echo search $HOST_DOMAIN **** $RESOLV_CONF
    [ -n "$DNS_IP_ADDR1" ] && echo nameserver $DNS_IP_ADDR1 **** $RESOLV_CONF
    [ -n "$DNS_IP_ADDR2" ] && echo nameserver $DNS_IP_ADDR2 **** $RESOLV_CONF
    fi
    echo "NET_SCRIPT**** wireless OK!!!"
    
    echo "NET_SCRIPT**** ethernet cable setting..."
    ifconfig $IF_0 0.0.0.0 &
    sleep 1
    [ ! -z "`/bin/pidof ifconfig`" ] && /usr/bin/killall -9 ifconfig
    ifconfig $IF_0 up
    ifconfig $IF_0 192.168.2.3 netmask 255.255.255.0 &
    sleep 2
    if [ ! -z "`/bin/pidof ifconfig`" ] ; then
    /usr/bin/killall -9 ifconfig
    ifconfig $IF_1 192.168.2.3 netmask 255.255.255.0 &
    sleep 2
    fi
    
    echo "NET_SCRIPT**** ethernet cable OK!!!"
    fi
    
    
    fi
    ######################################################
    ### alive
    ######################################################
    if [ "$ACTION" = "alive" ]; then
    rdate -s time.bora.net &
    fi
    ######################################################
    exit 0
    via telnet:

    mount-o remount, rw-t ext3 / dev/hda1 / SMP ...... ********** See corrected line in next post

    and at the end via FTP script created above to / MMP / usr / bin (replace existing lan_script.sh - for safety initially back up original script)

    Azbox restart.

    And when network settings, normally set up for wifi with WEP 128bit.

    Azbox Settings -> Wireless

    (WPA or WPA2) in red script editing worth

    for EPA WPAPSK
    for WPA2 WPA2PSK

    IP for LAN party. In this case is 192.168.2.3


    by Kameleon74
    Last edited by AJR; 06-04-2009 at 12:14 AM.

  2. #2
    V.I.P AJR's Avatar
    Join Date
    Dec 2008
    Posts
    691
    Thanks
    3
    Thanked 2 Times in 2 Posts
    It seems that the syntax of

    mount-o remount, rw-t ext3 / dev/hda1 / SMP
    is not correct, but the correct line is

    mount -o remount,rw -t ext3 /dev/hda1 /MMP

    with thanks to tinos for the correction.
    Last edited by AJR; 05-04-2009 at 11:44 PM.

  3. #3
    V.I.P elgeneral's Avatar
    Join Date
    Jan 2009
    Posts
    66
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Dual-Mode WLAN+LAN ab. 0.9.1759

    per telnet :

    mount -o remount,rw -t ext3 /dev/hda1 /MMP

    dann per FTP lan_script nach /MMP/usr/bin kopieren (vorhandene lan_script.sh ersetzen - fuer sicherheits vorerst originale Script sichern)

    Azbox neu starten.

    Dual-Mode ist active bei Azbox Einstellungen -> Wireless

    PS. IP fuer LAN ist Fest. In diese fall ist 192.168.2.3

  4. #4
    V.I.P
    Join Date
    Dec 2004
    Posts
    507
    Thanks
    10
    Thanked 3 Times in 3 Posts
    What is this script for?

  5. #5
    V.I.P AJR's Avatar
    Join Date
    Dec 2008
    Posts
    691
    Thanks
    3
    Thanked 2 Times in 2 Posts
    I believe that is so you can have lan (wired connection) and wan (wireless connection) running at the same time with 2 different ip addresses for the azbox.

Similar Threads

  1. lokking script *ps via 2.5
    By Dr Watson in forum Viaccess
    Replies: 0
    Last Post: 21-08-2007, 07:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •