mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
interfaces: refuse to run dhcp6c on unconfigured interfaces
LAN trackers use SIGHUP only so this is safe.
This commit is contained in:
parent
47f40e1782
commit
d8c8129889
@ -3047,13 +3047,17 @@ function interface_dhcpv6_prepare($interface = 'wan', $wancfg, $linkdownevent =
|
||||
|
||||
@file_put_contents('/var/etc/dhcp6c.conf', $dhcp6cconf);
|
||||
|
||||
$rtsoldscript = <<<EOD
|
||||
$rtsold_script = <<<EOD
|
||||
#!/bin/sh
|
||||
# this file was auto-generated, do not edit
|
||||
if [ -z "\${1}" ]; then
|
||||
echo "Nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f "/var/etc/dhcp6c_\${1}.conf" ]; then
|
||||
echo "No DHCPv6 configuration found for \${1}"
|
||||
exit 0
|
||||
fi
|
||||
if [ -n "\${2}" ]; then
|
||||
echo \${2} > /tmp/\${1}_routerv6
|
||||
echo \${2} > /tmp/\${1}_defaultgwv6
|
||||
@ -3073,7 +3077,7 @@ fi
|
||||
|
||||
EOD;
|
||||
|
||||
@file_put_contents('/var/etc/rtsold_script.sh', $rtsoldscript);
|
||||
@file_put_contents('/var/etc/rtsold_script.sh', $rtsold_script);
|
||||
@chmod('/var/etc/rtsold_script.sh', 0755);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user