rc.local
author ft
Tue, 04 Nov 2014 14:58:00 +0100
changeset 2 ee0797f46473
permissions -rwxr-xr-x
changed some things
ft@0
     1
#!/bin/sh -e
ft@0
     2
#
ft@0
     3
# rc.local
ft@0
     4
#
ft@0
     5
# This script is executed at the end of each multiuser runlevel.
ft@0
     6
# Make sure that the script will "exit 0" on success or any other
ft@0
     7
# value on error.
ft@0
     8
#
ft@0
     9
# In order to enable or disable this script just change the execution
ft@0
    10
# bits.
ft@0
    11
#
ft@0
    12
# By default this script does nothing.
ft@0
    13
ft@0
    14
getRemoteIp ()
ft@0
    15
{
ft@0
    16
	ip_address=$(ifconfig eth0 | grep "inet " | awk '{ print $2 }' | cut -d ":" -f 2)
ft@0
    17
	ip_netmask=$(ifconfig eth0 | grep "inet " | awk '{ print $4 }' | cut -d ":" -f 2)
ft@0
    18
	remote_ip=$(ipcalc $ip_address/$ip_netmask | grep HostMin | awk '{ print $2}')
ft@0
    19
ft@0
    20
	echo $remote_ip
ft@0
    21
}
ft@0
    22
ft@0
    23
ft@0
    24
# Disable error exit (not usefull for this command)
ft@0
    25
#set +e
ft@0
    26
#wget -q -T 3 -t 1 -O /dev/null http://$(getRemoteIp):8080/sdvm_started
ft@0
    27
#set -e
ft@0
    28
VBoxControl guestproperty set SDVMStarted True
ft@0
    29
ft@0
    30
ft@0
    31
exit 0