斌斌 大佬有话说 :
麻烦问个shell ip转发的脚本问题
我想写个sed -i ‘s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g’ /etc/sysctl.conf
替换/etc/sysctl.conf 文件里面net.ipv4.ip_forward = 0 为 /net.ipv4.ip_forward = 1,
但是如果里面没有/net.ipv4.ip_forward ,就添加一个,不会写,求高手帮帮忙。不会shell。
斌斌 大佬有话说 :
我想写个sed -i ‘s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g’ /etc/sysctl.conf
替换/etc/sysctl.conf 文件里面net.ipv4.ip_forward = 0 为 /net.ipv4.ip_forward = 1,
但是如果里面没有/net.ipv4.ip_forward ,就添加一个,不会写,求高手帮帮忙。不会shell。