From 75a63b9869a51af98f922e50ad824d9b5f7f782b Mon Sep 17 00:00:00 2001 From: RayWang910012 Date: Wed, 22 Feb 2023 17:11:29 +0800 Subject: [PATCH] [dhclient]Fix dhclient-hook inband-ztp permission errors. --- src/usr/lib/ztp/dhcp/inband-ztp-ip | 6 +++--- src/usr/lib/ztp/dhcp/inband-ztp-ip6 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/usr/lib/ztp/dhcp/inband-ztp-ip b/src/usr/lib/ztp/dhcp/inband-ztp-ip index f86ac48..f65e554 100755 --- a/src/usr/lib/ztp/dhcp/inband-ztp-ip +++ b/src/usr/lib/ztp/dhcp/inband-ztp-ip @@ -38,7 +38,7 @@ case $reason in if inband_interface_check ${interface} ; then if [ -n "$old_ip_address" ] && [ -n "$old_subnet_mask" ]; then prefix=$(IPprefix_by_netmask "${old_subnet_mask}") - config interface ip remove ${interface} ${old_ip_address}${prefix} + sudo config interface ip remove ${interface} ${old_ip_address}${prefix} fi fi ;; @@ -47,11 +47,11 @@ case $reason in if [ -n "$new_ip_address" ] && [ -n "$new_subnet_mask" ]; then if [ -n "$old_ip_address" ] && [ -n "$old_subnet_mask" ]; then prefix=$(IPprefix_by_netmask "${old_subnet_mask}") - config interface ip remove ${interface} ${old_ip_address}${prefix} + sudo config interface ip remove ${interface} ${old_ip_address}${prefix} fi prefix=$(IPprefix_by_netmask "${new_subnet_mask}") if [ "${prefix}" != "/0" ]; then - config interface ip add ${interface} ${new_ip_address}${prefix} + sudo config interface ip add ${interface} ${new_ip_address}${prefix} fi fi fi diff --git a/src/usr/lib/ztp/dhcp/inband-ztp-ip6 b/src/usr/lib/ztp/dhcp/inband-ztp-ip6 index cceb350..48f2df7 100755 --- a/src/usr/lib/ztp/dhcp/inband-ztp-ip6 +++ b/src/usr/lib/ztp/dhcp/inband-ztp-ip6 @@ -32,7 +32,7 @@ case $reason in else old_prefixlen=128 fi - config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen} + sudo config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen} fi fi ;; @@ -45,14 +45,14 @@ case $reason in else old_prefixlen=128 fi - config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen} + sudo config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen} fi if [ -n "${new_ip6_prefixlen}" ]; then prefixlen=${new_ip6_prefixlen} else prefixlen=128 fi - config interface ip add ${interface} ${new_ip6_address}/${new_ip6_prefixlen} + sudo config interface ip add ${interface} ${new_ip6_address}/${new_ip6_prefixlen} fi fi ;;