1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00
one/share/start-scripts/cron_start_script
Ricardo Diaz e239bfc0d6
M #-: Redesign of map vnets mapping script (#4461)
New design of vnets mapping script based on 'open3' instead of directly
command execution.
Added option to select which private and public networks are going to be
used to perform the mapping.

Signed-off-by: Ricardo Diaz <rdiaz@opennebula.systems>
2020-04-01 13:31:49 +02:00

23 lines
496 B
Bash

#!/bin/sh
sysctl -w net.ipv4.ip_forward=1
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} > /var/log/${script_name}.log 2>&1") | crontab -
exit 0