• # Script init.d

    Posté par . En réponse au journal Linux et WiFi. Évalué à 5.

    Le script /etc/rc.d/init.d/wifi que je me suis fait pour ceux que ça peut intéresser (mandrake 10.1 official) :

    #!/bin/bash
    # description: Script wifi pour carte à base de chipset acx111
    # chkconfig: 345 99 0

    # Source function library.
    . /etc/init.d/functions

    start ()
    {
    modprobe ndiswrapper;
    loadndisdriver gplus
    iwconfig wlan0 essid xxx key restricted xxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
    ifconfig wlan0 192.168.0.1 netmask 255.255.255.0 up;
    route add default gw 192.168.0.254 wlan0;
    echo "Wifi activé.";
    }

    stop ()
    {
    ifconfig wlan0 down;
    modprobe -r ndiswrapper;
    echo "Wifi désactivé";
    }

    restart() {
    stop
    start
    }

    rhstatus() {
    status ndiswrapper
    }

    case "1ドル" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart|reload)
    restart
    ;;
    *)
    gprintf "Usage: %s {start|stop|restart|}\n" "0ドル"
    exit 1
    esac

    exit 0