Neubau für die v962 Version
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5272 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
parent
a5cdb6ebcc
commit
c4fdee013e
Binary file not shown.
@ -14,13 +14,12 @@ author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
if [ -f /fastboot ]; then
|
if [ -f /fastboot ]; then
|
||||||
echo "Fast boot, no file system check"
|
echo "Fast boot, no file system check"
|
||||||
else
|
else
|
||||||
echo "Changing state of rootfs to ro"
|
|
||||||
/bin/mount -n -o remount,ro /
|
/bin/mount -n -o remount,ro /
|
||||||
evaluate_retval
|
status_message "change / to ro ..."
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
if [ -f /forcefsck ]; then
|
if [ -f /forcefsck ]; then
|
||||||
echo -n "/forcefsck exists, forcing "
|
echo -n "/forcefsck exists, forcing "
|
||||||
|
@ -9,9 +9,6 @@ start on startup
|
|||||||
description "Check if / ist nfs"
|
description "Check if / ist nfs"
|
||||||
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
||||||
|
|
||||||
# Note: there can be no previous runlevel here, if we have one it's bad
|
|
||||||
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
|
|
||||||
# without information so that it defaults to previous=N runlevel=S.
|
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
mount -t proc none /proc
|
mount -t proc none /proc
|
||||||
|
431
etc/event.d/functions
Executable file
431
etc/event.d/functions
Executable file
@ -0,0 +1,431 @@
|
|||||||
|
#!/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: /export/Data/cvs/Viitor_sysvinit/etc/init.d/functions,v $
|
||||||
|
#
|
||||||
|
#(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:
|
||||||
|
#Funktionen für die init scripten
|
||||||
|
#Dieses Script basiert auf der Vorlage des Linuxfromscratch Projetes
|
||||||
|
#
|
||||||
|
#Letzte Änderung von: $Author: kueller $
|
||||||
|
#Datum der letzten Änderung: $Date: 2004/03/03 12:48:07 $
|
||||||
|
#Version der Datei: $Revision: 1.12 $
|
||||||
|
#
|
||||||
|
#$Log: functions,v $
|
||||||
|
#Revision 1.12 2004/03/03 12:48:07 kueller
|
||||||
|
#Header auf neuen Viitor GPL Header umgestellt
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#Revision 1.11 2002/09/30 20:32:22 kueller
|
||||||
|
#Korrektur der Funktion getmasks - bei nichtvorhandener /etc/netmasks
|
||||||
|
#bricht die Funktion mit einem [] Fehler ab. Variable FOUND wurde
|
||||||
|
#in diesem Fall nicht gesetzt. Fehler behoben
|
||||||
|
#
|
||||||
|
#Revision 1.10 2002/09/23 20:22:09 hkueller
|
||||||
|
#Anpassung der Funktionen an BASH - dazu musste jedes typeset kommando
|
||||||
|
#entfernt werden, da bash keine zahlenumrechnung kann. Durch Neue Funktion
|
||||||
|
#GetShortMask problem mit short mask angabe bei ip kommando ohne verwendung
|
||||||
|
#von umrechnungsfunktionen gelöst.
|
||||||
|
#
|
||||||
|
#Revision 1.9 2002/09/11 18:16:05 hkueller
|
||||||
|
#Korrekturen bei der netzmask erkennung unter zsh
|
||||||
|
#
|
||||||
|
#Revision 1.8 2002/08/09 07:00:00 hkueller
|
||||||
|
#getmask vereinfacht und beschleunigt
|
||||||
|
#
|
||||||
|
#Revision 1.6 2002/05/05 14:40:08 hkueller
|
||||||
|
#mit neuem Release wandert basename von /usr/bin nach /bin. functions
|
||||||
|
#entsprechend angepasst
|
||||||
|
#
|
||||||
|
#Revision 1.5 2002/02/05 02:59:04 hkueller
|
||||||
|
#functions: getbroadcast() hinzugefuegt - gibt broadcast eines Netzes
|
||||||
|
# zurueck - Aufruf: getbroadcast <IP> <NETMASK>
|
||||||
|
# getmask erweitert - keine mask in /etc/netmasks ->
|
||||||
|
# defaultmask (Class A/B/C)
|
||||||
|
#networks: Ueberfaelliger eintrag fuer PTP entfernt
|
||||||
|
# Eintraege zur Konfiguration mit ifconfig hinzugefuegt - aber
|
||||||
|
# auskommentiert.
|
||||||
|
#
|
||||||
|
#Revision 1.4 2001/11/18 21:25:52 kueller
|
||||||
|
#Korrektur der Aufräumfunktion (sed Regulare Expression) für /etc/netmasks
|
||||||
|
#(getmask funktion)
|
||||||
|
#
|
||||||
|
#Revision 1.3 2001/11/17 23:41:35 kueller
|
||||||
|
#Network Setup erweitert. Netmasks werden jetzt aus /etc/netmasks erkannt.
|
||||||
|
#Konfiguration der Netmask in /etc/sysconfig/hostname.<if> nicht mehr
|
||||||
|
#notwendig!
|
||||||
|
#
|
||||||
|
#Revision 1.2 2001/11/17 22:20:33 kueller
|
||||||
|
#Funktionen dectohex und dectobin zur Umrechnung von dezimalen IP Adressen in
|
||||||
|
#Binäre bzw. Dezimale Darstellung hinzugefügt.
|
||||||
|
#Achtung: Diese Funktione funktionieren nur in Verbindung mit der zsh oder
|
||||||
|
#eine ksh - nicht mit sh oder bash!!!!
|
||||||
|
#
|
||||||
|
#Revision 1.1.1.1 2001/09/23 00:02:08 kueller
|
||||||
|
#Neustart wg. Datenverlust
|
||||||
|
#
|
||||||
|
#Revision 1.2 2001/08/25 10:14:28 kueller
|
||||||
|
#
|
||||||
|
#Optische Retusche der READY und FAILED Meldungen
|
||||||
|
#
|
||||||
|
#Revision 1.1.1.1 2001/08/08 10:02:32 kueller
|
||||||
|
#sysvinit addons
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$COLUMNS" ]; then
|
||||||
|
(( COL = $COLUMNS - 10 ))
|
||||||
|
else
|
||||||
|
COL=70
|
||||||
|
fi
|
||||||
|
SET_COL="/bin/echo -en \\033[${COL}G"
|
||||||
|
NORMAL="/bin/echo -en \\033[0;39m"
|
||||||
|
SUCCESS="/bin/echo -en \\033[1;42m"
|
||||||
|
FAILURE="/bin/echo -en \\033[1;41m"
|
||||||
|
|
||||||
|
evaluate_retval()
|
||||||
|
{
|
||||||
|
if [ $? = 0 ]
|
||||||
|
then
|
||||||
|
print_status success
|
||||||
|
else
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
status_message() {
|
||||||
|
STATUS=$?
|
||||||
|
Message=$1
|
||||||
|
if [ $# = 0 ]; then
|
||||||
|
echo "Usage: status_message <Message>"
|
||||||
|
fi
|
||||||
|
echo -n $Message
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
print_status success
|
||||||
|
else
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
print_status()
|
||||||
|
{
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: print_status {success|failure}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
success)
|
||||||
|
$SET_COL
|
||||||
|
$SUCCESS
|
||||||
|
echo -n " READY "
|
||||||
|
$NORMAL
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
failure)
|
||||||
|
$SET_COL
|
||||||
|
$FAILURE
|
||||||
|
echo -n " FAILED "
|
||||||
|
$NORMAL
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadproc()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: loadproc {program}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base=`/bin/basename $1`
|
||||||
|
|
||||||
|
pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base`
|
||||||
|
|
||||||
|
pid=""
|
||||||
|
|
||||||
|
for apid in $pidlist
|
||||||
|
do
|
||||||
|
if [ -d /proc/$apid ]
|
||||||
|
then
|
||||||
|
pid="$pid $apid"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -n "$pid" ]
|
||||||
|
then
|
||||||
|
$*
|
||||||
|
status_message "$* ..."
|
||||||
|
else
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
killproc()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: killproc {program} [signal]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base=`/bin/basename $1`
|
||||||
|
|
||||||
|
if [ "$2" != "" ]
|
||||||
|
then
|
||||||
|
killlevel=$2
|
||||||
|
else
|
||||||
|
nolevel=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base`
|
||||||
|
|
||||||
|
pid=""
|
||||||
|
|
||||||
|
for apid in $pidlist
|
||||||
|
|
||||||
|
do
|
||||||
|
if [ -d /proc/$apid ]
|
||||||
|
then
|
||||||
|
pid="$pid $apid"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$pid" ]
|
||||||
|
then
|
||||||
|
if [ "$nolevel" = 1 ]
|
||||||
|
then
|
||||||
|
/bin/kill -TERM $pid
|
||||||
|
if ps h $pid >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
/bin/kill -KILL $pid
|
||||||
|
fi
|
||||||
|
/bin/ps h $pid >/dev/null 2>&1
|
||||||
|
if [ $? = 0 ]
|
||||||
|
then
|
||||||
|
print_status failure
|
||||||
|
else
|
||||||
|
/bin/rm -f /var/run/$base.pid
|
||||||
|
print_status success
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
/bin/kill $killlevel $pid
|
||||||
|
/bin/ps h $pid >/dev/null 2>&1
|
||||||
|
if [ $? = 0 ]
|
||||||
|
then
|
||||||
|
print_status failure
|
||||||
|
else
|
||||||
|
/bin/rm -f /var/run/$base.pid
|
||||||
|
print_status success
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadproc()
|
||||||
|
{
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: reloadproc {program} [signal]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base=`/bin/basename $1`
|
||||||
|
|
||||||
|
if [ -n "$2" ]
|
||||||
|
then
|
||||||
|
killlevel=-$2
|
||||||
|
else
|
||||||
|
nolevel=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base`
|
||||||
|
|
||||||
|
pid=""
|
||||||
|
|
||||||
|
for apid in $pidlist
|
||||||
|
do
|
||||||
|
if [ -d /proc/$apid ]
|
||||||
|
then
|
||||||
|
pid="$pid $apid"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$pid" ]
|
||||||
|
then
|
||||||
|
if [ "$nolevel" = 1 ]
|
||||||
|
then
|
||||||
|
/bin/kill -SIGHUP $pid
|
||||||
|
evaluate_retval
|
||||||
|
else
|
||||||
|
/bin/kill -$killlevel $pid
|
||||||
|
evaluate_retval
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print_status failure
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
statusproc()
|
||||||
|
|
||||||
|
{
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: status {program}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pid=`/bin/pidof -o $$ -o $PPID -o %PPID -x $1`
|
||||||
|
if [ -n "$pid" ]
|
||||||
|
then
|
||||||
|
echo "$1 running with Process ID $pid"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /var/run/$1.pid ]
|
||||||
|
then
|
||||||
|
pid=`/usr/bin/head -1 /var/run/$1.pid`
|
||||||
|
if [ -n "$pid" ]
|
||||||
|
then
|
||||||
|
echo "$1 not running but /var/run/$1.pid exists"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$i is not running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getbroadcast() {
|
||||||
|
IP=$1
|
||||||
|
MASK=$2
|
||||||
|
for i in 1 2 3 4; do
|
||||||
|
IP[$i]=`echo $IP|awk -F. '{print $'$i'}'`
|
||||||
|
MASK[$i]=`echo $MASK|awk -F. '{print $'$i'}'`
|
||||||
|
(( BCAST[$i] = ${IP[$i]} | (( ${MASK[$i]} ^ 255 )) ))
|
||||||
|
done
|
||||||
|
echo ${BCAST[1]}.${BCAST[2]}.${BCAST[3]}.${BCAST[4]}
|
||||||
|
}
|
||||||
|
|
||||||
|
getnetaddr() {
|
||||||
|
IP=$1
|
||||||
|
MASK=$2
|
||||||
|
for i in 1 2 3 4; do
|
||||||
|
IPS=`echo $IP|awk -F. '{print $'$i'}'`
|
||||||
|
MASKS=`echo $MASK|awk -F. '{print $'$i'}'`
|
||||||
|
(( BCASTS = $IPS & $MASKS ))
|
||||||
|
if [ "$i" = "4" ]; then
|
||||||
|
printf "$BCASTS"
|
||||||
|
else
|
||||||
|
printf "$BCASTS."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
getmask() {
|
||||||
|
IP=$1
|
||||||
|
FOUND=0
|
||||||
|
if [ -f /etc/netmasks ]; then
|
||||||
|
sed -e "/^#/d" /etc/netmasks |\
|
||||||
|
sed -e "/^ *$/d" >/tmp/if
|
||||||
|
while read NETADDR NETMASK; do
|
||||||
|
NETIP=`getnetaddr $IP $NETMASK`
|
||||||
|
if [ "$NETADDR" = "$NETIP" ]; then
|
||||||
|
echo $NETMASK
|
||||||
|
FOUND=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done </tmp/if
|
||||||
|
rm /tmp/if
|
||||||
|
fi
|
||||||
|
if [ "$FOUND" -eq "0" ]; then
|
||||||
|
Byte=`echo $IP|awk -F . '{ print $1 }'`
|
||||||
|
if [ "$Byte" -le 127 ] && [ "$Byte" -ge 1 ]; then
|
||||||
|
echo "255.0.0.0"
|
||||||
|
elif [ "$Byte" -le 191 ] && [ "$Byte" -ge 128 ]; then
|
||||||
|
echo "255.255.0.0"
|
||||||
|
elif [ "$Byte" -le 223 ] && [ "$Byte" -ge 192 ]; then
|
||||||
|
echo "255.255.255.0"
|
||||||
|
else
|
||||||
|
echo "255.255.255.255"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
GetShortMask () {
|
||||||
|
IP=$1
|
||||||
|
NumIP=0
|
||||||
|
for i in 1 2 3 4; do
|
||||||
|
Byte=`echo $IP|awk -F . '{ print $'$i' }'`
|
||||||
|
if (( "$Byte" & 128 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 64 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 32 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 16 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 8 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 4 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 2 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
if (( "$Byte" & 1 )); then
|
||||||
|
(( NumIP = $NumIP + 1 ))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo $NumIP
|
||||||
|
}
|
||||||
|
|
||||||
|
initautomount() {
|
||||||
|
MOUNTSOURCE=$1
|
||||||
|
AUTOMOUNTSOURCE=$2
|
||||||
|
source /etc/sysconfig/autofstime
|
||||||
|
sed -e '/^#/d' |\
|
||||||
|
sed -e '/^ *$/d' >/tmp/autofs
|
||||||
|
exec 3</tmp/autofs
|
||||||
|
while read <&3 MOUNTPOINT FILE; do
|
||||||
|
echo -n "starting automount for $MOUNTPOINT ($MOUNTSOURCE)"
|
||||||
|
automount -t $TIMEOUT $MOUNTPOINT $AUTOMOUNTSOURCE,sun $FILE
|
||||||
|
status_message "automount is ..."
|
||||||
|
done
|
||||||
|
exec 3>&-
|
||||||
|
rm /tmp/autofs
|
||||||
|
}
|
||||||
|
# End /etc/init.d/functions
|
@ -11,9 +11,12 @@ start on stopped udevstart
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
|
source /etc/event.d/functions
|
||||||
if [ -f /etc/sysconfig/nodename ]; then
|
if [ -f /etc/sysconfig/nodename ]; then
|
||||||
/bin/hostname `cat /etc/sysconfig/nodename`
|
/bin/hostname `cat /etc/sysconfig/nodename`
|
||||||
|
status_message "Hostname set to $HOSTNAME"
|
||||||
else
|
else
|
||||||
/bin/hostname "localhost"
|
/bin/hostname "localhost"
|
||||||
|
status_message "Hostname set to $HOSTNAME"
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
@ -6,9 +6,11 @@
|
|||||||
start on started udev
|
start on started udev
|
||||||
|
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
for RC in /etc/hotplug/*.rc; do
|
for RC in /etc/hotplug/*.rc; do
|
||||||
$RC start
|
$RC start
|
||||||
done
|
done
|
||||||
touch /var/lock/subsys/hotplug
|
touch /var/lock/subsys/hotplug
|
||||||
|
echo -n "starting of hotplug"
|
||||||
|
print_status success
|
||||||
end script
|
end script
|
||||||
|
@ -9,6 +9,7 @@ stop on stopping mountfs
|
|||||||
console logged
|
console logged
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
|
WAITTIME=7
|
||||||
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
|
if [ -d /sys/class/net/$DEVNAME/wireless ]; then
|
||||||
@ -17,15 +18,62 @@ pre-start script
|
|||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
if [ -f /usr/sbin/ethtool ]; then
|
if [ -f /usr/sbin/ethtool ]; then
|
||||||
|
ifconfig $DEVNAME up
|
||||||
|
ZAHLER=0
|
||||||
|
if ! ethtool $DEVNAME|grep -q "No data available"; then
|
||||||
|
while [ ${ZAHLER} -le ${WAITTIME} ]; do
|
||||||
if [ `ethtool $DEVNAME|grep Link|awk '{print $3}'` == "yes" ]; then
|
if [ `ethtool $DEVNAME|grep Link|awk '{print $3}'` == "yes" ]; then
|
||||||
/sbin/if_up $DEVNAME
|
(( ZAHLER++ ))
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
ifconfig $DEVNAME up
|
||||||
|
ZAHLER=0
|
||||||
|
while [ ${ZAHLER} -le ${WAITTIME} ]; do
|
||||||
|
if [ "`cat /sys/class/net/$DEVNAME/carrier`" == "0" ]; then
|
||||||
|
(( ZAHLER++ ))
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
end script
|
||||||
|
|
||||||
|
script
|
||||||
|
for IF in `ld -d /sys/class/net/*[^lo]`; do
|
||||||
|
DEVNAME=`basename $IF`
|
||||||
|
if [ -f /usr/sbin/ethtool ]; then
|
||||||
|
DEVSTATUS=`ethtool $DEVNAME|grep Link|awk '{print $3}'`
|
||||||
|
fi
|
||||||
|
if [ "$DEVSTATUS" == "yes" ] || [ `cat /sys/class/net/$DEVNAME/carrier` == "1" ]; then
|
||||||
/sbin/if_up $DEVNAME
|
/sbin/if_up $DEVNAME
|
||||||
|
touch /var/run/net_up
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
end script
|
end script
|
||||||
|
|
||||||
|
post-start script
|
||||||
|
if [ ! -f /var/run/net_up ] && [ -f /etc/nsswitch.default ]; then
|
||||||
|
cp /etc/nsswitch.files /etc/nsswitch.conf
|
||||||
|
touch /var/state/ldap_disable
|
||||||
|
else
|
||||||
|
if [ ! -f /var/run/nsswitch_done ] && [ -f /etc/nsswitch.default ]; then
|
||||||
|
cp /etc/nsswitch.default /etc/nsswitch.conf
|
||||||
|
touch /var/state/ldap_disable
|
||||||
|
fi
|
||||||
|
if [ -f /var/run/net_up ]; then
|
||||||
|
rm /var/run/net_up
|
||||||
|
fi
|
||||||
|
if [ -f /var/run/nsswitch.done ]; then
|
||||||
|
rm /var/run/nsswitch.done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
end script
|
||||||
|
|
||||||
post-stop script
|
post-stop script
|
||||||
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`
|
||||||
|
@ -16,15 +16,13 @@ console logged
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
if [ -f /sbin/vgscan ]; then
|
if [ -f /sbin/vgscan ]; then
|
||||||
echo -n "Scanning Volumes"
|
|
||||||
/sbin/vgscan >/dev/null 2>&1
|
/sbin/vgscan >/dev/null 2>&1
|
||||||
evaluate_retval
|
status_message "Scanning of Volumes....."
|
||||||
for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do
|
for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do
|
||||||
echo -n "Activating Volume $i"
|
vgchange -a -y $i
|
||||||
vgchange -a y $i
|
status_message "Volume Aktivation of $i ..."
|
||||||
evaluate_retval
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
@ -11,16 +11,15 @@ start on started mountfs
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
if [ -f /etc/sysconfig/kbd/setkeys ]; then
|
if [ -f /etc/sysconfig/kbd/setkeys ]; then
|
||||||
echo -n "Loading Special kbd mappings"
|
|
||||||
exec 3</etc/sysconfig/kbd/setkeys
|
exec 3</etc/sysconfig/kbd/setkeys
|
||||||
while read <&3 CODE MAP; do
|
while read <&3 CODE MAP; do
|
||||||
setkeycodes $CODE $MAP
|
setkeycodes $CODE $MAP
|
||||||
done
|
done
|
||||||
evaluate_retval
|
status_message "Load of Special kbd mappings..."
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
fi
|
fi
|
||||||
echo -n "Loading keymap..."
|
|
||||||
/bin/loadkeys -d >/dev/null
|
/bin/loadkeys -d >/dev/null
|
||||||
|
status_message "Load Keymap ..."
|
||||||
end script
|
end script
|
||||||
|
@ -7,13 +7,14 @@ start on started udev
|
|||||||
stop on stopping udev
|
stop on stopping udev
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
if [ -f /etc/sysconfig/loadmods ]; then
|
if [ -f /etc/sysconfig/loadmods ]; then
|
||||||
sed -e "/^#/d" /etc/sysconfig/loadmods |
|
sed -e "/^#/d" /etc/sysconfig/loadmods |
|
||||||
sed -e "/^ *$/d" >/tmp/loadmods
|
sed -e "/^ *$/d" >/tmp/loadmods
|
||||||
exec 3</tmp/loadmods
|
exec 3</tmp/loadmods
|
||||||
while read <&3 MODULE OPTIONS; do
|
while read <&3 MODULE OPTIONS; do
|
||||||
modprobe -s $MODULE $OPTIONS
|
modprobe -s $MODULE $OPTIONS
|
||||||
|
status_message "Load of KernelModule $MODULE..."
|
||||||
done
|
done
|
||||||
rm /tmp/loadmods
|
rm /tmp/loadmods
|
||||||
fi
|
fi
|
||||||
|
@ -12,9 +12,13 @@ console logged
|
|||||||
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
|
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
|
||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
pre-start script
|
pre-start script
|
||||||
|
source /etc/event.d/functions
|
||||||
/sbin/ifconfig lo 127.0.0.1
|
/sbin/ifconfig lo 127.0.0.1
|
||||||
|
status_message "Setup local net..."
|
||||||
end script
|
end script
|
||||||
|
|
||||||
post-stop script
|
post-stop script
|
||||||
|
source /etc/event.d/functions
|
||||||
/sbin/ifconfig lo down
|
/sbin/ifconfig lo down
|
||||||
|
status_message "Remove Local Net..."
|
||||||
end script
|
end script
|
||||||
|
@ -16,7 +16,7 @@ author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
pre-start script
|
pre-start script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
echo -n "Remounting rootfs in rw mode..."
|
echo -n "Remounting rootfs in rw mode..."
|
||||||
/bin/mount -n -o remount,rw /
|
/bin/mount -n -o remount,rw /
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
@ -42,7 +42,7 @@ pre-start script
|
|||||||
end script
|
end script
|
||||||
|
|
||||||
post-stop script
|
post-stop script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
|
|
||||||
echo -n "Deactivating swap..."
|
echo -n "Deactivating swap..."
|
||||||
/sbin/swapoff -a
|
/sbin/swapoff -a
|
||||||
|
@ -9,27 +9,25 @@ stop on stopping nfsclient
|
|||||||
console output
|
console output
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
||||||
MOUNTPOINT=$i
|
MOUNTPOINT=$i
|
||||||
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
|
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
|
||||||
if [ "$FILESYSTEM" == "nfs" ]; then
|
if [ "$FILESYSTEM" == "nfs" ]; then
|
||||||
echo -n "Mounting nfs $MOUNTPOINT"
|
|
||||||
mount $MOUNTPOINT
|
mount $MOUNTPOINT
|
||||||
evaluate_retval
|
status_message "Mount nfs Filesystem on $MOUNTPOINT"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
end script
|
end script
|
||||||
|
|
||||||
post-stop script
|
post-stop script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
||||||
MOUNTPOINT=$i
|
MOUNTPOINT=$i
|
||||||
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
|
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
|
||||||
if [ "$FILESYSTEM" == "nfs" ]; then
|
if [ "$FILESYSTEM" == "nfs" ]; then
|
||||||
echo -n "Mounting nfs $MOUNTPOINT"
|
|
||||||
umount $MOUNTPOINT
|
umount $MOUNTPOINT
|
||||||
evaluate_retval
|
status_message "umount NFS Filesystem from $MOUNTPOINT"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
end script
|
end script
|
||||||
|
@ -11,11 +11,9 @@ start on varmake
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
echo -n "Mounting tmpfs on /var"
|
|
||||||
mount -t tmpfs none /var
|
mount -t tmpfs none /var
|
||||||
evaluate_retval
|
status_message "Mount tmpfs on /var"
|
||||||
echo -n "Getting Hostname ..."
|
|
||||||
ifconfig|\
|
ifconfig|\
|
||||||
grep Protokoll|\
|
grep Protokoll|\
|
||||||
awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices
|
awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices
|
||||||
@ -33,14 +31,12 @@ script
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo -n " $HOSTNAME"
|
status_message "Getting Hostname $HOSTNAME.."
|
||||||
evaluate_retval
|
|
||||||
echo -n "Restoring var folder"
|
|
||||||
cd /var
|
cd /var
|
||||||
tar -zxf /boot/var_${HOSTNAME}.tgz
|
tar -zxf /boot/var_${HOSTNAME}.tgz
|
||||||
echo $HOSTNAME >etc/sysconfig/nodename
|
echo $HOSTNAME >etc/sysconfig/nodename
|
||||||
cd -
|
cd -
|
||||||
evaluate_retval
|
status_message "Restore of /var folder"
|
||||||
umount /proc
|
umount /proc
|
||||||
/sbin/initctl mount_virtual
|
/sbin/initctl mount_virtual
|
||||||
end script
|
end script
|
||||||
|
@ -8,7 +8,7 @@ start on started ifup
|
|||||||
console logged
|
console logged
|
||||||
|
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
if [ ! -f /etc/sysconfig/net/notrouter ]; then
|
if [ ! -f /etc/sysconfig/net/notrouter ]; then
|
||||||
echo "Configuring System with routing allowed"
|
echo "Configuring System with routing allowed"
|
||||||
if [ -f /etc/sysconfig/net/gateways ]; then
|
if [ -f /etc/sysconfig/net/gateways ]; then
|
||||||
@ -18,14 +18,12 @@ script
|
|||||||
read <&3 TYPE NETWORK OPTION GW NETMASK
|
read <&3 TYPE NETWORK OPTION GW NETMASK
|
||||||
while [ $TYPE ]; do
|
while [ $TYPE ]; do
|
||||||
if [ "$OPTION" == "dev" ]; then
|
if [ "$OPTION" == "dev" ]; then
|
||||||
echo -n "Adding device Route to $NETWORK with $NETMASK on $GW"
|
|
||||||
route add -$TYPE $NETWORK netmask $NETMASK dev $GW
|
route add -$TYPE $NETWORK netmask $NETMASK dev $GW
|
||||||
evaluate_retval
|
status_message "Device route to $NETWORK with $NETMASK on $GW"
|
||||||
fi
|
fi
|
||||||
if [ "$OPTION" == "gw" ]; then
|
if [ "$OPTION" == "gw" ]; then
|
||||||
echo -n "Adding net Route to $NETWORK with $NETMASK and gw $GW"
|
|
||||||
route add -$TYPE $NETWORK netmask $NETMASK gw $GW
|
route add -$TYPE $NETWORK netmask $NETMASK gw $GW
|
||||||
evaluate_retval
|
status_message "Net Route to $NETWORK with $NETMASK and gw $GW"
|
||||||
fi
|
fi
|
||||||
read <&3 TYPE NETWORK OPTION GW NETMASK
|
read <&3 TYPE NETWORK OPTION GW NETMASK
|
||||||
done
|
done
|
||||||
@ -33,15 +31,13 @@ script
|
|||||||
rm /tmp/gateways
|
rm /tmp/gateways
|
||||||
fi
|
fi
|
||||||
if [ -f /etc/sysconfig/net/defaultrouter ]; then
|
if [ -f /etc/sysconfig/net/defaultrouter ]; then
|
||||||
echo -n "setting up defaultrouter `cat /etc/sysconfig/net/defaultrouter`"
|
route add default gw `cat /etc/sysconfig/net/defaultrouter`
|
||||||
$DEBUG route add default gw `cat /etc/sysconfig/net/defaultrouter`
|
status_message "Default Router set to `cat /etc/sysconfig/net/defaultrouter`"
|
||||||
evaluate_retval
|
|
||||||
fi
|
fi
|
||||||
NUMIF=`ip -f inet addr show|grep inet|wc -l`
|
NUMIF=`ip -f inet addr show|grep inet|grep -v "host lo"|wc -l`
|
||||||
if [ $NUMIF -gt 2 ]; then
|
if [ $NUMIF -gt 2 ]; then
|
||||||
echo -n "Enable ip_forwarding"
|
|
||||||
echo "1" >/proc/sys/net/ipv4/ip_forward
|
echo "1" >/proc/sys/net/ipv4/ip_forward
|
||||||
evaluate_retval
|
status_message "Enable of ip_forwarding"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
@ -11,14 +11,13 @@ start on started mountfs
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
CLOCKPARAMS="--hctosys"
|
CLOCKPARAMS="--hctosys"
|
||||||
case "$UTC" in
|
case "$UTC" in
|
||||||
yes|true|1)
|
yes|true|1)
|
||||||
CLOCKPARAMS="$CLOCKPARAMS -u"
|
CLOCKPARAMS="$CLOCKPARAMS -u"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo -n "Setting clock.."
|
|
||||||
/sbin/hwclock $CLOCKPARAMS
|
/sbin/hwclock $CLOCKPARAMS
|
||||||
evaluate_retval
|
status_message "Load of hwclock..."
|
||||||
end script
|
end script
|
||||||
|
@ -12,28 +12,25 @@ start on start udev
|
|||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
if [ -f /sbin/udevstart ]; then
|
if [ -f /sbin/udevstart ]; then
|
||||||
. /etc/init.d/functions
|
. /etc/event.d/functions
|
||||||
. /etc/udev/udev.conf
|
. /etc/udev/udev.conf
|
||||||
prog=udev
|
prog=udev
|
||||||
szsfs_dir=/sys
|
sysfs_dir=/sys
|
||||||
bin=/lib/udev
|
bin=/lib/udev
|
||||||
udevd=/sbin/udevd
|
udevd=/sbin/udevd
|
||||||
udev_root=/dev
|
udev_root=/dev
|
||||||
echo "Bringing udev system up"
|
echo "Bringing udev system up"
|
||||||
echo -n "mounting sys"
|
|
||||||
mount -t sysfs none /sys
|
mount -t sysfs none /sys
|
||||||
evaluate_retval
|
status_message "mount of sys..."
|
||||||
echo -n ".../var/lock"
|
|
||||||
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 $udev_root ]; then
|
||||||
mkdir $udev_root
|
mkdir $udev_root
|
||||||
fi
|
fi
|
||||||
evaluate_retval
|
status_message "Creation ov /var/lock..."
|
||||||
echo -n ".../dev "
|
|
||||||
mount -t tmpfs none /dev
|
mount -t tmpfs none /dev
|
||||||
evaluate_retval
|
status_message "Mounting tmpfs to /dev..."
|
||||||
export ACTION=add
|
export ACTION=add
|
||||||
echo -n "Creating initial udev device nodes"
|
echo -n "Creating initial udev device nodes"
|
||||||
/sbin/udevstart
|
/sbin/udevstart
|
||||||
|
@ -6,15 +6,11 @@ start on varmake
|
|||||||
|
|
||||||
#stop on runlevel
|
#stop on runlevel
|
||||||
|
|
||||||
# Note: there can be no previous runlevel here, if we have one it's bad
|
|
||||||
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
|
|
||||||
# without information so that it defaults to previous=N runlevel=S.
|
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
echo -n "Mounting tmpfs on /var"
|
source /etc/init.d/functions
|
||||||
mount -t tmpfs none /var
|
mount -t tmpfs none /var
|
||||||
evaluate_retval
|
status_message "Mount of tmpfs to /var ...."
|
||||||
echo -n "Getting Hostname ..."
|
|
||||||
ifconfig|\
|
ifconfig|\
|
||||||
grep Protokoll|\
|
grep Protokoll|\
|
||||||
awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices
|
awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices
|
||||||
@ -33,12 +29,11 @@ script
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo -n " $HOSTNAME"
|
echo -n " $HOSTNAME"
|
||||||
evaluate_retval
|
status_message "Trying to find out hostname..."
|
||||||
echo -n "Restoring var folder"
|
|
||||||
cd /var
|
cd /var
|
||||||
tar -zxf /boot/var_${HOSTNAME}.tgz
|
tar -zxf /boot/var_${HOSTNAME}.tgz
|
||||||
echo $HOSTNAME >etc/sysconfig/nodename
|
echo $HOSTNAME >etc/sysconfig/nodename
|
||||||
cd -
|
cd -
|
||||||
evaluate_retval
|
status_message "Restore of var Filesystem..."
|
||||||
/sbin/initctl emit start udev
|
/sbin/initctl emit start udev
|
||||||
end script
|
end script
|
||||||
|
@ -11,19 +11,17 @@ start on stopped udevstart
|
|||||||
# without information so that it defaults to previous=N runlevel=S.
|
# without information so that it defaults to previous=N runlevel=S.
|
||||||
console output
|
console output
|
||||||
script
|
script
|
||||||
source /etc/init.d/functions
|
source /etc/event.d/functions
|
||||||
echo -n "Changing state of rootfs to rw"
|
|
||||||
/bin/mount -n -o remount,rw /
|
/bin/mount -n -o remount,rw /
|
||||||
evaluate_retval
|
status_message "Changing state of rootfs to rw"
|
||||||
echo >/dev/mtab
|
echo >/dev/mtab
|
||||||
/bin/mount -f -o remount,rw /
|
/bin/mount -f -o remount,rw /
|
||||||
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
|
||||||
MOUNTPOINT=$i
|
MOUNTPOINT=$i
|
||||||
DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab`
|
DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab`
|
||||||
if [ "$DEVICE" == "none" ]; then
|
if [ "$DEVICE" == "none" ]; then
|
||||||
echo -n "Mounting $MOUNTPOINT"
|
|
||||||
mount $MOUNTPOINT
|
mount $MOUNTPOINT
|
||||||
evaluate_retval
|
status_message "Mounting $MOUNTPOINT ..."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
end script
|
end script
|
||||||
|
@ -9,9 +9,11 @@ stop on stopping rpc
|
|||||||
console output
|
console output
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
|
source /etc/event.d/functions
|
||||||
if [ -f /etc/sysconfig/nis/defaultdomain ]; then
|
if [ -f /etc/sysconfig/nis/defaultdomain ]; then
|
||||||
domainname `cat /etc/sysconfig/nis/defaultdomain`
|
domainname `cat /etc/sysconfig/nis/defaultdomain`
|
||||||
/usr/sbin/ypbind
|
/usr/sbin/ypbind
|
||||||
|
status_message "ypclient started"
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
@ -36,7 +36,8 @@ if [ ! "$DEV" ]; then
|
|||||||
exit 10
|
exit 10
|
||||||
fi
|
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}'`
|
kill `ps -ef|grep dhclient|grep ${DEV}|awk '{print $2}'`
|
||||||
|
ifconfig $DEV 0.0.0.0 down
|
||||||
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}'`
|
||||||
|
14
sbin/if_up
14
sbin/if_up
@ -36,21 +36,25 @@ if [ ! "$DEV" ]; then
|
|||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then
|
||||||
|
echo -n "Setting up ${DEV} with dhcp"
|
||||||
dhclient -q ${DEV}
|
dhclient -q ${DEV}
|
||||||
elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then
|
evaluate_retval
|
||||||
HOST=`cat /etc/sysconfig/net/hostname.${DEV}|awk '{print $1}'`
|
elif ls /etc/sysconfig/net/hostname.${DEV}* &>/dev/null; then
|
||||||
|
for NETDEV in `ls /etc/sysconfig/net/hostname.${DEV}*|awk -F "." '{print $2}'`; do
|
||||||
|
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}'`
|
||||||
NETMASK=`getmask $IP`
|
NETMASK=`getmask $IP`
|
||||||
SHMASK=`GetShortMask $NETMASK`
|
SHMASK=`GetShortMask $NETMASK`
|
||||||
echo -n "setting up interface $i:IP=$IP NMASK=$NETMASK"
|
echo -n "setting up interface $NETDEV:IP=$IP NMASK=$NETMASK"
|
||||||
if [ "$NETMASK" = "" ]; then
|
if [ "$NETMASK" = "" ]; then
|
||||||
DEV=`echo $i|cut -d ":" -f 1`
|
DEV=`echo $NETDEV|cut -d ":" -f 1`
|
||||||
$DEBUG ip addr add $IP broadcast + dev $DEV
|
$DEBUG ip addr add $IP broadcast + dev $DEV
|
||||||
$DEBUG ip link set $DEV up
|
$DEBUG ip link set $DEV up
|
||||||
else
|
else
|
||||||
DEV=`echo $i|cut -d ":" -f 1`
|
DEV=`echo $NETDEV|cut -d ":" -f 1`
|
||||||
$DEBUG ip addr add $IP/$SHMASK broadcast + dev $DEV
|
$DEBUG ip addr add $IP/$SHMASK broadcast + dev $DEV
|
||||||
$DEBUG ip link set $DEV up
|
$DEBUG ip link set $DEV up
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
evaluate_retval
|
evaluate_retval
|
||||||
fi
|
fi
|
||||||
|
@ -35,11 +35,17 @@
|
|||||||
#
|
#
|
||||||
source /etc/init.d/functions
|
source /etc/init.d/functions
|
||||||
|
|
||||||
|
if [ ! -f /var/state/ldap_disable ]; then
|
||||||
|
touch /var/state/ldap_disable
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
@ -66,6 +72,19 @@ for AP in `iwlist $DEV scan 2>/dev/null|\
|
|||||||
echo -n "Configuring txpower to $ARG1"
|
echo -n "Configuring txpower to $ARG1"
|
||||||
$DEBUG iwconfig $DEV txpower $ARG1
|
$DEBUG iwconfig $DEV txpower $ARG1
|
||||||
;;
|
;;
|
||||||
|
YP)
|
||||||
|
echo "domain $ARG1 server $ARG2" >/etc/yp.conf
|
||||||
|
NISSTR="nis"
|
||||||
|
;;
|
||||||
|
LDAP)
|
||||||
|
export USE_LDAP=1
|
||||||
|
LDAPSTR="ldap"
|
||||||
|
rm /var/state/ldap_disable
|
||||||
|
;;
|
||||||
|
DNS)
|
||||||
|
echo "#Resolv.conf generatet by wlan_setup" >/etc/resolv.conf
|
||||||
|
echo "nameserver $ARG1" >>/etc/resolv.conf
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
read <&3 OPTION ARG1 ARG2
|
read <&3 OPTION ARG1 ARG2
|
||||||
done
|
done
|
||||||
@ -73,3 +92,20 @@ for AP in `iwlist $DEV scan 2>/dev/null|\
|
|||||||
rm /tmp/AP
|
rm /tmp/AP
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
FILESTR="files"
|
||||||
|
echo "passwd: $FILESTR $LDAPSTR $NISSTR" >$NSSWITCH
|
||||||
|
echo "group: $FILESTR $LDAPSTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "shadow: $FILESTR $LDAPSTR" >>$NSSWITCH
|
||||||
|
echo "publickkey: $FILESTR" >>$NSSWITCH
|
||||||
|
echo "hosts: dns $FILESTR $LDAPSTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "networks: $FILESTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "protocols: db $NISSTR $FILESTR" >>$NSSWITCH
|
||||||
|
echo "services: db $NISSTR $FILESTR" >>$NSSWITCH
|
||||||
|
echo "rpc: db $NISSTR $FILESTR" >>$NSSWITCH
|
||||||
|
echo "ethers: db $NISSTR $FILESTR" >>$NSSWITCH
|
||||||
|
echo "netmasks: $FILESTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "netgroup: $FILESTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "bootparams: $FILESTR" >>$NSSWITCH
|
||||||
|
echo "automount: $FILESTR $NISSTR" >>$NSSWITCH
|
||||||
|
echo "aliases: $FILESTR" >>$NSSWITCH
|
||||||
|
touch /var/run/nsswitch_done
|
||||||
|
Loading…
Reference in New Issue
Block a user