archive : RPM :  Lealinux Forums The fastest message board... ever.
FORUM FERMÉ 
Script non executable
Envoyé par: Sansfin ()
Date: Wednesday 1 November 2006 19:05:12

Bonjour,
Je suis sur SUSE Linux 10.1.

J'ai installé correctement le dongle UR054g.

J'en suis à l'étape du srcipt de démarrage :
En tant que root, j'ai crée le fichier de configuration /etc/sysconfig/livebox contenant :
#Périphérique
WLAN="wlan0"
#ESSID de la livebox
ESSID="WANADOO-XXXX"
#Clef WEP
WEP="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX

Puis, j'ai crée le script de démarrage /etc/init.d/livebox contenant :
#!/bin/sh
# (c) Lea-Linux, Jean-Christophe Cardot <jice(at)lea(dash)linux(dot)org>
#
# livebox This shell script takes care of starting and stopping
# your livebox's wifi dongle and configure it.
#
# chkconfig: 2345 12 88
# description: This startup script configures the Livebox's USB wifi dongle

if [ -f /etc/sysconfig/livebox ];then
source /etc/sysconfig/livebox
fi

PIDFILE=/etc/dhcpc/dhcpcd-$WLAN.pid

. /etc/rc.d/init.d/functions

function get_ip() {
ip_wlan=$(ifconfig $WLAN 2>&1 \
| grep "inet adr:" \
| cut -d' ' -f 12 | cut -d':' -f 2)
if [ "$ip_wlan" = "127.0.0.1" ]; then
unset ip_wlan
fi
}

function wifistart() {
# test if already started
unset ip_wlan
get_ip
if [ "x$ip_wlan" != "x" ]; then
echo "Wifi already started!"
exit 0
fi
# make sure dhcpcd is stopped
if [ -s $PIDFILE ] \
&& ps aux | cut -b10-15 | grep -q `cat $PIDFILE`; then
kill -SIGTERM `cat $PIDFILE` 2>&1 >/dev/null
fi
rm -rf $PIDFILE 2>&1 >/dev/null
action "Lancement de NDISWrapper" \
modprobe ndiswrapper
action "Lancement du wifi Livebox" \
iwconfig $WLAN mode managed essid $ESSID key $WEP
action "Obtention d'une adresse IP avec DHCP" \
/sbin/dhcpcd wlan0
get_ip
echo "Adresse IP : $ip_wlan"
}

function wifistop() {
action "Arrêt du wifi Livebox" \
ifconfig $WLAN down
action "Arrêt de NDISWrapper" \
rmmod ndiswrapper
if [ -s $PIDFILE ] \
&& ps aux|cut -b10-15|grep -q `cat $PIDFILE`; then
action "Arrêt de dhcpcd" \
kill -SIGTERM `cat $PIDFILE`
fi
rm -rf $PIDFILE 2>&1 >/dev/null
}

case $1 in
start)
wifistart
exit 0
;;
stop)
wifistop
exit 0
;;
status)
if fgrep -q ndiswrapper /proc/modules; then
gprintf "NDISWrapper loaded."
echo
else
gprintf "NDISWrapper not loaded."
echo
fi
if ifconfig 2>&1 | grep -q $WLAN; then
gprintf "$WLAN wireless interface loaded."
echo
else
gprintf "$WLAN wireless interface not loaded."
echo
fi
unset ip_wlan
get_ip
if [ "x$ip_wlan" = "x" ]; then
gprintf "No IP address"
echo
else
gprintf "IP Adress: $ip_wlan"
echo
fi
exit 0
;;
restart)
;;
reload)
$0 stop
$0 start
exit 0
;;
*)
gprintf "Usage: %s\n" "$(basename $0) {start|stop|restart|status}"
exit 0
;;
esac

exit 0





Pour finir, je tape dans le shell :
# chkconfig --add livebox
insserv: script livebox is not executable, skipped!
livebox 0yawning smileyff 1yawning smileyff 2yawning smileyff 3yawning smileyff 4yawning smileyff 5yawning smileyff 6yawning smileyff


Que dois-je faire ??

Merci

Options: RépondreCiter
Re: Script non executable
Envoyé par: twocats ()
Date: Wednesday 1 November 2006 22:43:37

Le fichier de configuration /etc/sysconfig/livebox est incorrect :
#Périphérique
WLAN="wlan0"
#ESSID de la livebox
ESSID="WANADOO-XXXX"
#Clef WEP
WEP="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX"
Pour rendre le script éxécutable :
chmod +x /etc/init.d/livebox

-------------------
La réponse est 42

Options: RépondreCiter


Désolé, vous n'avez pas la permission d'envoyer ou de répondre dans ce forum.
This forum powered by Phorum.