Files
one/share/start-scripts/cron_start_script
T
Ricardo Diaz 739b463e65 F #-: Floating IPs start script (#4382)
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>
2020-03-24 11:05:41 +01:00

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