Viitor_upstart/etc/init/varmake.conf
kueller 79b2635d46 Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_upstart@5933 504e572c-2e33-0410-9681-be2bf7408885
2011-01-03 10:48:06 +00:00

39 lines
1.2 KiB
Plaintext

description "Make special handling for ro nfs root"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on varmake
console output
script
source /etc/init.d/functions
mount -t tmpfs none /var
status_message "Mount of tmpfs to /var ...."
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"
status_message "Trying to find out hostname..."
cd /var
tar -zxf /boot/var_${HOSTNAME}.tgz
echo $HOSTNAME >etc/sysconfig/nodename
cd -
status_message "Restore of var Filesystem..."
/sbin/initctl emit startudev
end script