100 lines
2.5 KiB
Plaintext
100 lines
2.5 KiB
Plaintext
|
#!/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<72>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:
|
|||
|
#rcS Script des sysvinit Projektes
|
|||
|
#Basierend auf einer Vorlage von linuxfromscratch.org
|
|||
|
#
|
|||
|
#Letzte <20>nderung von: $Author$
|
|||
|
#Datum der letzten <20>nderung: $Date$
|
|||
|
#Version der Datei: $Revision$
|
|||
|
#
|
|||
|
|
|||
|
# Begin /etc/init.d/rcS
|
|||
|
|
|||
|
runlevel=S
|
|||
|
prevlevel=N
|
|||
|
umask 022
|
|||
|
export runlevel prevlevel
|
|||
|
|
|||
|
trap ":" INT QUIT TSTP
|
|||
|
|
|||
|
source /etc/init.d/functions
|
|||
|
|
|||
|
mount -t proc none /proc
|
|||
|
|
|||
|
if mount|grep /dev/root|grep nfs &>/dev/null; then
|
|||
|
echo -n "Mounting tmpfs on /var"
|
|||
|
mount -t tmpfs none /var
|
|||
|
evaluate_retval
|
|||
|
echo -n "Getting Hostname ..."
|
|||
|
ifconfig|\
|
|||
|
grep Protokoll|\
|
|||
|
awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices
|
|||
|
for i in `cat /var/devices`; do
|
|||
|
INET=`ifconfig $i|\
|
|||
|
grep inet|\
|
|||
|
awk -F ":" '{print $2}'|\
|
|||
|
awk '{print $1}'`
|
|||
|
ANET=`echo $INET|awk -F "." '{print $1}'`
|
|||
|
if [ ! "$ANET" == "127" ]; then
|
|||
|
HOSTNAME=`getent hosts $INET`
|
|||
|
HOSTNAME=`echo $HOSTNAME|\
|
|||
|
awk '{print $2}'|\
|
|||
|
awk -F "." '{print $1}'`
|
|||
|
break
|
|||
|
fi
|
|||
|
done
|
|||
|
echo -n " $HOSTNAME"
|
|||
|
evaluate_retval
|
|||
|
echo -n "Restoring var folder"
|
|||
|
cd /var
|
|||
|
tar -zxf /boot/var_${HOSTNAME}.tgz
|
|||
|
echo $HOSTNAME >etc/sysconfig/nodename
|
|||
|
cd -
|
|||
|
evaluate_retval
|
|||
|
else
|
|||
|
mount -t tmpfs none /var/lock
|
|||
|
fi
|
|||
|
|
|||
|
umount /proc
|
|||
|
|
|||
|
if [ -f /sbin/udevd ]; then
|
|||
|
echo -n "Mounting /sys"
|
|||
|
mount -t sysfs none /sys
|
|||
|
evaluate_retval
|
|||
|
if [ ! -d /var/lock/subsys ]; then
|
|||
|
mkdir /var/lock/subsys
|
|||
|
fi
|
|||
|
if [ ! -d /dev ]; then
|
|||
|
mkdir /dev
|
|||
|
fi
|
|||
|
fi
|
|||
|
|
|||
|
for i in /etc/init.d/rcS.d/S??*
|
|||
|
do
|
|||
|
[ ! -f "$i" ] && continue;
|
|||
|
$i start
|
|||
|
done
|
|||
|
|
|||
|
# End /etc/init.d/rcS
|