Compare commits
No commits in common. "v961" and "v963" have entirely different histories.
97
etc/init.d/dbus
Executable file
97
etc/init.d/dbus
Executable file
@ -0,0 +1,97 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
||||||
|
#dieses Framework wird im CVS Repository
|
||||||
|
#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt
|
||||||
|
#
|
||||||
|
#Lage dieser Datei im Archiv: $Source$
|
||||||
|
#
|
||||||
|
#(c) 2003 Harald Kueller, Germany
|
||||||
|
#This program is free software; you can redistribute it and/or
|
||||||
|
#modify ist under the terms of the GNU General Public License
|
||||||
|
#as published by the Free Software Foundation; either version
|
||||||
|
#2 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
#This program is distributed in the hope that it will be useful,
|
||||||
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
#You should have received a copy of the GNU General Public License
|
||||||
|
#along with this program; if not write to the Free Software Foundation,
|
||||||
|
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
#InitScript zum Start des Daemons:
|
||||||
|
#
|
||||||
|
#Letzte Änderung von: $Author: kueller $
|
||||||
|
#Datum der letzten Änderung: $Date: 2009-04-27 13:14:47 +0200 (Mo, 27 Apr 2009) $
|
||||||
|
#Version der Datei: $Revision: 4633 $
|
||||||
|
#
|
||||||
|
#$Log$
|
||||||
|
#Revision 1.7 2007/04/28 20:13:35 kueller
|
||||||
|
#Entspricht eigentlich wieder der Version 1.5 -> Rev. 1.6 war ein
|
||||||
|
#Fehlerhafter checkin eines Files fuer /etc/sysconfig/profile.d,
|
||||||
|
#nicht fuer /etc/init.d
|
||||||
|
#
|
||||||
|
#Revision 1.5 2007/04/13 09:22:39 kueller
|
||||||
|
#Anpassung des startup -> Dbus wird nun mit systemweiter Konfiguration gestartet
|
||||||
|
#neue postinstall installiert den in der neuen version erwarteten user messagebus
|
||||||
|
#
|
||||||
|
#Revision 1.4 2007/04/12 10:01:17 kueller
|
||||||
|
#Startup fehler wegen vorhandenem /var/run/dbus/pid nach
|
||||||
|
#system absturz wird nun aufgefangen
|
||||||
|
#
|
||||||
|
#Revision 1.3 2007/02/18 08:59:04 kueller
|
||||||
|
#PATH erweitert, so das dbus-launch, sowie die zugehoerigen daemons gefunden
|
||||||
|
#werden.
|
||||||
|
#
|
||||||
|
#Revision 1.2 2006/07/18 13:26:27 kueller
|
||||||
|
#Aufgrund neuer configure optionen (sysstatedir) ist /var/run/dbus nun ein
|
||||||
|
#verzeichniss. initscript entsprechend geaendert. Ausserdem wird mehrmaliges
|
||||||
|
#aufrufen mit "stop" option jetzt abgefangen
|
||||||
|
#
|
||||||
|
#Revision 1.1.1.1 2006/07/18 12:54:21 kueller
|
||||||
|
#Startup Script fuer dbus
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
source /etc/init.d/functions
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
if [ -f /var/run/dbus/pid ]; then
|
||||||
|
if [ "`pgrep dbus-daemon`" == "`cat /var/run/dbus/pid`" ]; then
|
||||||
|
echo "The dbus deamon is already running with pid `cat /var/run/dbus/pid`"
|
||||||
|
exit 10
|
||||||
|
else
|
||||||
|
rm /var/run/dbus/*
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
export PATH=$PATH:/usr/X11R7/bin
|
||||||
|
echo -n "Starting dbus messaging system"
|
||||||
|
dbus-daemon --system
|
||||||
|
evaluate_retval
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
if [ ! -f /var/run/dbus/pid ]; then
|
||||||
|
echo "dbus is not running!"
|
||||||
|
exit 10
|
||||||
|
fi
|
||||||
|
echo -n "Stopping dbus messaging system"
|
||||||
|
kill `cat /var/run/dbus/pid` &&
|
||||||
|
rm /var/run/dbus/pid &&
|
||||||
|
evaluate_retval
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
@ -100,33 +100,7 @@ case "$1" in
|
|||||||
start)
|
start)
|
||||||
for IF in `ls -d /sys/class/net/*[^lo]`; do
|
for IF in `ls -d /sys/class/net/*[^lo]`; do
|
||||||
DEVNAME=`basename $IF`
|
DEVNAME=`basename $IF`
|
||||||
if [ -d /sys/class/net/$DEVNAME/wireless ]; then
|
|
||||||
/sbin/wlan_setup $DEVNAME
|
|
||||||
#give wlan a chance go create link
|
|
||||||
sleep 1
|
|
||||||
fi
|
|
||||||
if [ -f /usr/sbin/ethtool ]; then
|
|
||||||
#Einige Dumme Interfaces (z.B. die VMware Emulationen) Zeiten
|
|
||||||
#den korrekten Status erst nach einem ifconfig up
|
|
||||||
ifconfig $DEVNAME up
|
|
||||||
WAITTIME=7
|
|
||||||
ZAHLER=0
|
|
||||||
while [ ${ZAHLER} -le ${WAITTIME} ]; do
|
|
||||||
if [ ! `ethtool $DEVNAME|grep Link|awk '{print $3}'` == "yes" ]; then
|
|
||||||
(( ZAHLER++ ))
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
if [ "`ethtool $DEVNAME|grep Link|awk '{print $3}'`" == "yes" ]; then
|
|
||||||
/sbin/if_up $DEVNAME
|
/sbin/if_up $DEVNAME
|
||||||
touch /var/run/net_up
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
/sbin/if_up $DEVNAME
|
|
||||||
touch /var/run/net_up
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
if [ ! -f /var/run/net_up ] && [ -f /etc/nsswitch.default ]; then
|
if [ ! -f /var/run/net_up ] && [ -f /etc/nsswitch.default ]; then
|
||||||
cp /etc/nsswitch.files /etc/nsswitch.conf
|
cp /etc/nsswitch.files /etc/nsswitch.conf
|
||||||
|
@ -58,7 +58,7 @@ if [ -f /etc/sysconfig/kbd/setkeys ]; then
|
|||||||
fi
|
fi
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
echo -n "Loading keymap..."
|
echo -n "Loading keymap..."
|
||||||
/bin/loadkeys -d >/dev/null
|
/usr/bin/loadkeys -d >/dev/null
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
|
|
||||||
# End /etc/init.d/loadkeys
|
# End /etc/init.d/loadkeys
|
||||||
|
@ -53,6 +53,11 @@ case "$1" in
|
|||||||
read <&3 MODULE OPTIONS
|
read <&3 MODULE OPTIONS
|
||||||
while [ $MODULE ]; do
|
while [ $MODULE ]; do
|
||||||
echo -n "Loading Module $MODULE with options: $OPTIONS"
|
echo -n "Loading Module $MODULE with options: $OPTIONS"
|
||||||
|
if grep -q $MODULE /proc/modules; then
|
||||||
|
echo -n "Module $MODULE already loaded - removing it"
|
||||||
|
rmmod $MODULE
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
modprobe -s $MODULE $OPTIONS
|
modprobe -s $MODULE $OPTIONS
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
read <&3 MODULE OPTIONS
|
read <&3 MODULE OPTIONS
|
||||||
|
@ -28,41 +28,6 @@
|
|||||||
#Datum der letzten Änderung: $Date$
|
#Datum der letzten Änderung: $Date$
|
||||||
#Version der Datei: $Revision$
|
#Version der Datei: $Revision$
|
||||||
#
|
#
|
||||||
#$Log$
|
|
||||||
#Revision 1.8 2007/06/09 13:43:20 kueller
|
|
||||||
#Erkennung ob / nfs ist, und sonderbehandlung fuer nfs boot eingebaut.
|
|
||||||
#angepasst an zukuenftigen Viitor_netboot
|
|
||||||
#
|
|
||||||
#Revision 1.7 2007/04/30 18:05:04 kueller
|
|
||||||
#Neue Udev initialisierung. Ist jetzt konform zur doku und funktioniert auch
|
|
||||||
#
|
|
||||||
#Revision 1.6 2007/04/28 19:59:58 kueller
|
|
||||||
#an /dev muss vor dem start von udev ein tmpfs sein...
|
|
||||||
#
|
|
||||||
#Revision 1.5 2006/07/07 20:36:18 kueller
|
|
||||||
#Umstellung auf udev. es wird kein devfsd mehr gestartet. dafuer muss unter
|
|
||||||
#/dev ein tmpfs gemountet werden. ausserdem muss for dem start von
|
|
||||||
#udevstart (legt die devicefiles fuer die im Kernel vorhandenen Geraete an)
|
|
||||||
#das sysfs gemountet werden.
|
|
||||||
#
|
|
||||||
#Revision 1.4 2004/03/03 12:48:08 kueller
|
|
||||||
#Header auf neuen Viitor GPL Header umgestellt
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#Revision 1.3 2002/01/21 16:52:44 kueller
|
|
||||||
#Volumemanagement wird im Script mountfs initialisiert, nicht mehr hier
|
|
||||||
#
|
|
||||||
#Revision 1.2 2001/11/03 23:55:39 segler
|
|
||||||
#
|
|
||||||
#LVM moechte gerne bevor es so richtig tut einen /sbin/vgscan haben. Solls kriegen...
|
|
||||||
#
|
|
||||||
#Revision 1.1.1.1 2001/09/23 00:02:08 kueller
|
|
||||||
#Neustart wg. Datenverlust
|
|
||||||
#
|
|
||||||
#Revision 1.1.1.1 2001/08/08 10:02:32 kueller
|
|
||||||
#sysvinit addons
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Begin /etc/init.d/rcS
|
# Begin /etc/init.d/rcS
|
||||||
|
|
||||||
@ -113,30 +78,16 @@ fi
|
|||||||
|
|
||||||
umount /proc
|
umount /proc
|
||||||
|
|
||||||
if [ -f /sbin/udevstart ]; then
|
if [ -f /sbin/udevd ]; then
|
||||||
. /etc/init.d/functions
|
echo -n "Mounting /sys"
|
||||||
. /etc/udev/udev.conf
|
|
||||||
prog=udev
|
|
||||||
sysfs_dir=/sys
|
|
||||||
bin=/lib/udev
|
|
||||||
udevd=/sbin/udevd
|
|
||||||
udev_root=/dev
|
|
||||||
echo "Bringing udev sytem up"
|
|
||||||
echo -n "mounting sys "
|
|
||||||
mount -t sysfs none /sys
|
mount -t sysfs none /sys
|
||||||
echo -n "/var/lock "
|
evaluate_retval
|
||||||
if [ ! -d /var/lock/subsys ]; then
|
if [ ! -d /var/lock/subsys ]; then
|
||||||
mkdir /var/lock/subsys
|
mkdir /var/lock/subsys
|
||||||
fi
|
fi
|
||||||
if [ ! -d $udev_root ]; then
|
if [ ! -d /dev ]; then
|
||||||
mkdir $udev_root
|
mkdir /dev
|
||||||
fi
|
fi
|
||||||
echo -n "/dev "
|
|
||||||
mount -t tmpfs none /dev
|
|
||||||
export ACTION=add
|
|
||||||
echo -n "Creating initial udev device nodes:"
|
|
||||||
loadproc udevstart
|
|
||||||
mkdir /dev/pts
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in /etc/init.d/rcS.d/S??*
|
for i in /etc/init.d/rcS.d/S??*
|
||||||
|
@ -62,14 +62,15 @@ for i in *; do
|
|||||||
done
|
done
|
||||||
mkdir rc{S,0,1,2,3,4,5,6}.d
|
mkdir rc{S,0,1,2,3,4,5,6}.d
|
||||||
cd rcS.d
|
cd rcS.d
|
||||||
ln -s ../checkfs S05checkfs
|
ln -s ../checkfs S10checkfs
|
||||||
ln -s ../mountfs S10mountfs
|
ln -s ../mountfs S15mountfs
|
||||||
ln -s ../setclock S20setclock
|
ln -s ../setclock S20setclock
|
||||||
ln -s ../loadkeys S30loadkeys
|
ln -s ../loadkeys S25loadkeys
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
for i in 0 6; do
|
for i in 0 6; do
|
||||||
cd rc$i.d
|
cd rc$i.d
|
||||||
|
ln -s ../dbus K74dbus
|
||||||
ln -s ../ifup K80ifup
|
ln -s ../ifup K80ifup
|
||||||
ln -s ../sendsignals K80sendsignals
|
ln -s ../sendsignals K80sendsignals
|
||||||
ln -s ../loadmodules K87loadmodules
|
ln -s ../loadmodules K87loadmodules
|
||||||
@ -80,6 +81,7 @@ done
|
|||||||
cd rc0.d
|
cd rc0.d
|
||||||
ln -s ../halt S99halt
|
ln -s ../halt S99halt
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd rc6.d
|
cd rc6.d
|
||||||
ln -s ../reboot S99reboot
|
ln -s ../reboot S99reboot
|
||||||
cd ..
|
cd ..
|
||||||
@ -92,6 +94,7 @@ for i in 1 2 3 4 5; do
|
|||||||
ln -s ../ifup S10ifup
|
ln -s ../ifup S10ifup
|
||||||
ln -s ../routing S11routing
|
ln -s ../routing S11routing
|
||||||
ln -s ../install S11install
|
ln -s ../install S11install
|
||||||
|
ln -s ../dbus S12dbus
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
ln -s ../init.d init.d
|
ln -s ../init.d init.d
|
||||||
|
43
sbin/if_down
43
sbin/if_down
@ -35,14 +35,25 @@ if [ ! "$DEV" ]; then
|
|||||||
echo "Usage: $0 <NetworkInterfaceName>"
|
echo "Usage: $0 <NetworkInterfaceName>"
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
if pgrep vtun >/dev/null; then
|
||||||
|
/etc/init.d/vtund stop
|
||||||
|
fi
|
||||||
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
||||||
kill `ps -ef|grep dhclient|grep eth0|awk '{print $2}'`
|
echo -n "Stopping dhclient for $DEV"
|
||||||
|
DHPID=`ps -ef|grep dhclient|grep ${DEV}|awk '{print $2}'`
|
||||||
|
if [ "$DHPID" ]; then
|
||||||
|
kill $DHPID
|
||||||
|
fi
|
||||||
|
evaluate_retval
|
||||||
|
echo -n "Shutting down Interface $DEV"
|
||||||
|
ifconfig $DEV 0.0.0.0 down
|
||||||
|
evaluate_retval
|
||||||
elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then
|
elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then
|
||||||
HOST=`cat /etc/sysconfig/net/hostname.${DEV}|awk '{print $1}'`
|
HOST=`cat /etc/sysconfig/net/hostname.${DEV}|awk '{print $1}'`
|
||||||
IP=`grep $HOST /etc/hosts|awk '{print $1}'`
|
IP=`grep $HOST /etc/hosts|awk '{print $1}'`
|
||||||
NETMASK=`getmask $IP`
|
NETMASK=`getmask $IP`
|
||||||
SHMASK=`GetShortMask $NETMASK`
|
SHMASK=`GetShortMask $NETMASK`
|
||||||
echo -n "setting up interface $i:IP=$IP NMASK=$NETMASK"
|
echo -n "shutting down interface $i:IP=$IP NMASK=$NETMASK"
|
||||||
if [ "$NETMASK" = "" ]; then
|
if [ "$NETMASK" = "" ]; then
|
||||||
DEV=`echo $i|cut -d ":" -f 1`
|
DEV=`echo $i|cut -d ":" -f 1`
|
||||||
$DEBUG ip addr del $IP broadcast + dev $DEV
|
$DEBUG ip addr del $IP broadcast + dev $DEV
|
||||||
@ -54,3 +65,31 @@ elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then
|
|||||||
fi
|
fi
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
fi
|
fi
|
||||||
|
if [ -f /var/run/shutdown/wlan_nis ]; then
|
||||||
|
if [ -f /etc/sysconfig/nis/defaultdomain.wlan ]; then
|
||||||
|
echo -n "Restoring nis defaultdomain"
|
||||||
|
mv /etc/sysconfig/nis/defaultdomain.wlan \
|
||||||
|
/etc/sysconfig/nis/defaultdomain
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
|
if [ -f /etc/yp.conf.wlan ]; then
|
||||||
|
echo -n "Restoring nis yp.conf"
|
||||||
|
mv /etc/yp.conf.wlan \
|
||||||
|
/etc/yp.conf
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
|
rm /var/run/shutdown/wlan_nis
|
||||||
|
if [ -f /var/run/shutdown/wlan_dns ]; then
|
||||||
|
if [ -f /etc/resolv.conf.wlan ]; then
|
||||||
|
echo -n "Restoring resolv.conf"
|
||||||
|
mv /etc/resolv.conf.wlan /etc/resolv.conf
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
|
rm /var/run/shutdown/wlan_dns
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if pgrep wpa_supplicant >/dev/null; then
|
||||||
|
echo -n "Stopping wpa_supplicant"
|
||||||
|
pkill wpa_supplicant
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
|
67
sbin/if_up
67
sbin/if_up
@ -30,16 +30,79 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
source /etc/init.d/functions
|
source /etc/init.d/functions
|
||||||
|
|
||||||
DEV=$1
|
DEV=$1
|
||||||
|
|
||||||
|
CheckForLink() {
|
||||||
|
NETDEVICE=$1
|
||||||
|
if [ -f /usr/sbin/ethtool ]; then
|
||||||
|
#Einige Dumme Interfaces (z.B. die VMware Emulationen) Zeiten
|
||||||
|
#den korrekten Status erst nach einem ifconfig up
|
||||||
|
WAITTIME=7
|
||||||
|
ZAHLER=0
|
||||||
|
if ! ethtool $NETDEVICE|grep -q "No data available"; then
|
||||||
|
while [ ${ZAHLER} -le ${WAITTIME} ]; do
|
||||||
|
if [ ! `ethtool $NETDEVICE|grep Link|awk '{print $3}'` == "yes" ]; then
|
||||||
|
(( ZAHLER++ ))
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
if [ `ethtool $NETDEVICE|grep Link|awk '{print $3}'` == "yes" ]; then
|
||||||
|
touch /var/run/net_up
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
touch /var/run/net_up
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
touch /var/run/net_up
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! "$DEV" ]; then
|
if [ ! "$DEV" ]; then
|
||||||
echo "Usage: $0 <NetworkInterfaceName>"
|
echo "Usage: $0 <NetworkInterfaceName>"
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Check for files in /etc/sysconfig/net
|
||||||
|
#hostname.<if> will setup static ip for the interfaces, based
|
||||||
|
#on /etc/hosts (hostname) and /etc/networks (netmask/Broadcast)
|
||||||
|
#<if>.dhcp will do a dynamic setup for the interface with dhcp
|
||||||
|
|
||||||
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
||||||
|
#ok this is the dynamic part for setup ${DEV}
|
||||||
|
#first we have to startup interface to check interface type
|
||||||
|
ifconfig ${DEV} up
|
||||||
|
#Let check in /sys if the interface is a wireless interface
|
||||||
|
if [ -d /sys/class/net/${DEV}/wireless ]; then
|
||||||
|
#wireless interface need special setup..
|
||||||
|
/sbin/wlan_setup ${DEV}
|
||||||
|
#give wlan time to startup and create a link
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
#let check if there is a link on the interface.
|
||||||
|
#only if there is a link, we will setup the interface..
|
||||||
|
if CheckForLink ${DEV}; then
|
||||||
echo -n "Setting up ${DEV} with dhcp"
|
echo -n "Setting up ${DEV} with dhcp"
|
||||||
dhclient -q ${DEV}
|
dhclient -q ${DEV}
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
|
else
|
||||||
|
ifconfig ${DEV} down
|
||||||
|
fi
|
||||||
elif ls /etc/sysconfig/net/hostname.${DEV}* &>/dev/null; then
|
elif ls /etc/sysconfig/net/hostname.${DEV}* &>/dev/null; then
|
||||||
|
ifconfig ${DEV} up
|
||||||
|
if [ -d /sys/class/net/${DEV}/wireless ]; then
|
||||||
|
/sbin/wlan_setup ${DEV}
|
||||||
|
#give wlan time to startup and create a link
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
if CheckForLink ${DEV}; then
|
||||||
for NETDEV in `ls /etc/sysconfig/net/hostname.${DEV}*|awk -F "." '{print $2}'`; do
|
for NETDEV in `ls /etc/sysconfig/net/hostname.${DEV}*|awk -F "." '{print $2}'`; do
|
||||||
HOST=`cat /etc/sysconfig/net/hostname.${NETDEV}|awk '{print $1}'`
|
HOST=`cat /etc/sysconfig/net/hostname.${NETDEV}|awk '{print $1}'`
|
||||||
IP=`grep $HOST /etc/hosts|awk '{print $1}'`
|
IP=`grep $HOST /etc/hosts|awk '{print $1}'`
|
||||||
@ -56,5 +119,7 @@ elif ls /etc/sysconfig/net/hostname.${DEV}* &>/dev/null; then
|
|||||||
$DEBUG ip link set $DEV up
|
$DEBUG ip link set $DEV up
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
evaluate_retval
|
else
|
||||||
|
ifconfig ${DEV} down
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -39,12 +39,16 @@ if [ ! -f /var/state/ldap_disable ]; then
|
|||||||
touch /var/state/ldap_disable
|
touch /var/state/ldap_disable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d /var/run/shutdown ]; then
|
||||||
|
mkdir -p /var/run/shutdown
|
||||||
|
fi
|
||||||
NSSWITCH=/etc/nsswitch.conf
|
NSSWITCH=/etc/nsswitch.conf
|
||||||
DEV=$1
|
DEV=$1
|
||||||
if [ ! "$DEV" ]; then
|
if [ ! "$DEV" ]; then
|
||||||
echo "usage: $0 <WireLessLanDevice>"
|
echo "usage: $0 <WireLessLanDevice>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
/sbin/ifconfig $DEV up
|
||||||
if [ ! -d /sys/class/net/$DEV/wireless ]; then
|
if [ ! -d /sys/class/net/$DEV/wireless ]; then
|
||||||
echo "No Wireless Device"
|
echo "No Wireless Device"
|
||||||
exit 2
|
exit 2
|
||||||
@ -63,6 +67,9 @@ for AP in `iwlist $DEV scan 2>/dev/null|\
|
|||||||
read <&3 OPTION ARG1 ARG2
|
read <&3 OPTION ARG1 ARG2
|
||||||
while [ $OPTION ]; do
|
while [ $OPTION ]; do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
|
WPA2|WPA)
|
||||||
|
wpa_supplicant -i ${DEV} -D ${ARG1} -c /etc/sysconfig/wpa_supplicant/${AP} -B
|
||||||
|
;;
|
||||||
KEY)
|
KEY)
|
||||||
echo -n "Configuring Wireless Interface KEY"
|
echo -n "Configuring Wireless Interface KEY"
|
||||||
$DEBUG iwconfig $DEV key $ARG1 $ARG2
|
$DEBUG iwconfig $DEV key $ARG1 $ARG2
|
||||||
@ -72,7 +79,33 @@ for AP in `iwlist $DEV scan 2>/dev/null|\
|
|||||||
$DEBUG iwconfig $DEV txpower $ARG1
|
$DEBUG iwconfig $DEV txpower $ARG1
|
||||||
;;
|
;;
|
||||||
YP)
|
YP)
|
||||||
|
if [ -f /var/run/shutdown/wlan_nis ]; then
|
||||||
|
echo "No Clean Shutdown, cleaning up"
|
||||||
|
if [ -f /etc/sysconfig/nis/defaultdomain.wlan ]; then
|
||||||
|
mv /etc/sysconfig/nis/defaultdomain.wlan \
|
||||||
|
/etc/sysconfig/nis/defaultdomain
|
||||||
|
elif [ -f /etc/sysconfig/nis/defaultdomain ]; then
|
||||||
|
rm /etc/sysconfig/nis/defaultdomain
|
||||||
|
fi
|
||||||
|
if [ -f /etc/yp.conf.wlan ]; then
|
||||||
|
mv /etc/yp.conf.wlan /etc/yp.conf
|
||||||
|
elif [ -f /etc/yp.conf ]; then
|
||||||
|
rm /etc/yp.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
touch /var/run/shutdown/wlan_nis
|
||||||
|
if [ "$ARG1" ]; then
|
||||||
|
if [ -f /etc/sysconfig/nis/defaultdomain ]; then
|
||||||
|
mv /etc/sysconfig/nis/defaultdomain{,.wlan}
|
||||||
|
fi
|
||||||
|
echo "$ARG1" >/etc/sysconfig/nis/defaultdomain
|
||||||
|
fi
|
||||||
|
if [ "$ARG2" ]; then
|
||||||
|
if [ -f /etc/yp.conf ]; then
|
||||||
|
mv /etc/yp.conf{,.wlan}
|
||||||
|
fi
|
||||||
echo "domain $ARG1 server $ARG2" >/etc/yp.conf
|
echo "domain $ARG1 server $ARG2" >/etc/yp.conf
|
||||||
|
fi
|
||||||
NISSTR="nis"
|
NISSTR="nis"
|
||||||
;;
|
;;
|
||||||
LDAP)
|
LDAP)
|
||||||
@ -81,13 +114,29 @@ for AP in `iwlist $DEV scan 2>/dev/null|\
|
|||||||
rm /var/state/ldap_disable
|
rm /var/state/ldap_disable
|
||||||
;;
|
;;
|
||||||
DNS)
|
DNS)
|
||||||
|
if [ -f /var/run/shutdown/wlan_dns ]; then
|
||||||
|
echo "No Clean Shutdown, cleaning up"
|
||||||
|
if [ -f /etc/resolv.conf.wlan ]; then
|
||||||
|
mv /etc/resolv.conf.wlan /etc/resolv.conf
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
touch /var/run/shutdown/wlan_dns
|
||||||
|
if [ -f /etc/resolv.conf ]; then
|
||||||
|
mv /etc/resolv.conf{,.wlan}
|
||||||
|
fi
|
||||||
echo "#Resolv.conf generatet by wlan_setup" >/etc/resolv.conf
|
echo "#Resolv.conf generatet by wlan_setup" >/etc/resolv.conf
|
||||||
echo "nameserver $ARG1" >>/etc/resolv.conf
|
echo "nameserver $ARG1" >>/etc/resolv.conf
|
||||||
;;
|
;;
|
||||||
|
VTUN)
|
||||||
|
echo "Starting vtun client"
|
||||||
|
/etc/init.d/vtund start
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
read <&3 OPTION ARG1 ARG2
|
read <&3 OPTION ARG1 ARG2
|
||||||
done
|
done
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
|
ifconfig $DEV down
|
||||||
|
ifconfig $DEV up
|
||||||
rm /tmp/AP
|
rm /tmp/AP
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user