rc.local
changeset 0 60bc07f3f415
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rc.local	Thu Feb 27 17:12:59 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +#!/bin/sh -e
     1.5 +#
     1.6 +# rc.local
     1.7 +#
     1.8 +# This script is executed at the end of each multiuser runlevel.
     1.9 +# Make sure that the script will "exit 0" on success or any other
    1.10 +# value on error.
    1.11 +#
    1.12 +# In order to enable or disable this script just change the execution
    1.13 +# bits.
    1.14 +#
    1.15 +# By default this script does nothing.
    1.16 +
    1.17 +getRemoteIp ()
    1.18 +{
    1.19 +	ip_address=$(ifconfig eth0 | grep "inet " | awk '{ print $2 }' | cut -d ":" -f 2)
    1.20 +	ip_netmask=$(ifconfig eth0 | grep "inet " | awk '{ print $4 }' | cut -d ":" -f 2)
    1.21 +	remote_ip=$(ipcalc $ip_address/$ip_netmask | grep HostMin | awk '{ print $2}')
    1.22 +
    1.23 +	echo $remote_ip
    1.24 +}
    1.25 +
    1.26 +
    1.27 +# Disable error exit (not usefull for this command)
    1.28 +#set +e
    1.29 +#wget -q -T 3 -t 1 -O /dev/null http://$(getRemoteIp):8080/sdvm_started
    1.30 +#set -e
    1.31 +VBoxControl guestproperty set SDVMStarted True
    1.32 +
    1.33 +
    1.34 +exit 0