Viitor_upstart/etc/event.d/nfsroot
kueller 7b7f6e837b V961 Tree Umbau
git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_upstart@4329 504e572c-2e33-0410-9681-be2bf7408885
2008-05-03 16:59:18 +00:00

47 lines
1.5 KiB
Plaintext

# rcS - runlevel compatibility
#
# This task runs the old sysv-rc startup scripts.
start on varmake
#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
script
source /etc/init.d/functions
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
umount /proc
/sbin/initctl mount_virtual
end script