Jak na razie zrobiłem mały szkielet, jeszcze muszę ogarnąć jak się uruchamia sieć bezprzewodową w Debianie (Kubuntu). Chodzi tutaj bardziej o to jak się to robi z nowymi sterownikami Intela do mojej karty sieciowej (iwl coś tam). Teraz nie mam kompa (w robocie Windows), więc nie mam jak zobaczyć czy działa.
Oto skrypt:
#! /bin/sh
# /etc/init.d/wiNet.sh
#
# variables and configuration
iface=wlan0 # wireless interface
# Some things that run always
touch /var/lock/wiNet
# functions
function startNetwork {
if [ status -ne 0 ] ; then
echo "Starting wireless network ... "
# TODO: starting code
if [ status -ne 0 ]; then
echo "[ FAIL ]"
exit 1
else
echo "[ OK ]"
exit 0
fi
else
echo "The network is already up!"
exit 0
fi
}
function stopNetwork {
if [ status -ne 0 ] ; then
echo "The network is not up!"
exit 0
else
echo "Stopping wireless network ... "
/usr/sbin/ifconfig $iface down
if [ status -ne 0 ]; then
echo "[ OK ]"
exit 0
else
echo "[ FAIL ]"
exit 1
fi
fi
}
function status {
/usr/sbin/ping -c 1 -w 2 wp.pl > /dev/null
if [ $? -ne 0 ] ; then
return 1 # net down
else
return 0 # net up
fi
}
# Carry out specific functions when asked to by the system
case "$1" in
start)
startNetwork
;;
stop)
stopNetwork
;;
restart)
stopNetwork
startNetwork
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac

No comments yet
RSS dla komentarzy tego wpisu