mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
New script to be used as start script on virtual machines. It get all NIC_ALIAS IPs associated to NIC IPs of a service using OneGate, and install iptables SNAT and DNAT rules to get connectivity with the VM using the ALIAS_NIC IP. Signed-off-by: Ricardo Diaz <rdiaz@opennebula.systems>
20 lines
427 B
Bash
20 lines
427 B
Bash
#!/bin/sh
|
|
|
|
script_name="$(echo $FILES_DS | sed -n 's/.*:\x27\(.*\)\x27/\1/p')"
|
|
|
|
map_vnets_script_dst="/usr/local/bin/${script_name}"
|
|
if [ -f ${map_vnets_script_dst} ]
|
|
then
|
|
# Already installed
|
|
exit 1
|
|
fi
|
|
|
|
map_vnets_script_src="$MOUNT_DIR/${script_name}"
|
|
|
|
cp "${map_vnets_script_src}" "${map_vnets_script_dst}"
|
|
chmod +x "${map_vnets_script_dst}"
|
|
|
|
(crontab -l ; echo "*/1 * * * * ${map_vnets_script_dst}") | crontab -
|
|
|
|
exit 0
|