2010-04-20 12:58:29 +00:00
|
|
|
description "Special Handling for nfs / (root) Filesystem"
|
|
|
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|
|
|
version 1.0
|
|
|
|
emits none special
|
2008-05-03 17:03:02 +00:00
|
|
|
|
|
|
|
start on varmake
|
|
|
|
|
|
|
|
console output
|
|
|
|
script
|
2010-04-20 12:58:29 +00:00
|
|
|
source /etc/init/functions
|
2008-05-03 17:03:02 +00:00
|
|
|
mount -t tmpfs none /var
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "Mount tmpfs on /var"
|
2008-05-03 17:03:02 +00:00
|
|
|
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
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "Getting Hostname $HOSTNAME.."
|
2008-05-03 17:03:02 +00:00
|
|
|
cd /var
|
|
|
|
tar -zxf /boot/var_${HOSTNAME}.tgz
|
|
|
|
echo $HOSTNAME >etc/sysconfig/nodename
|
|
|
|
cd -
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "Restore of /var folder"
|
2008-05-03 17:03:02 +00:00
|
|
|
umount /proc
|
|
|
|
/sbin/initctl mount_virtual
|
|
|
|
end script
|