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