pc_delete "dhcp-option=dnsf5" $CONFIG
pc_delete "dhcp-option=dnsf6" $CONFIG
pc_append "dhcp-script=/jffs/scripts/log-dhcp.sh" $CONFIG
pc_append "neg-ttl=3600" $CONFIG
pc_delete "no-negcache" $CONFIG
pc_delete "servers-file=/tmp/resolv.dnsmasq" $CONFIG
I'm not sure I follow exactly what it is you're doing, but the helper functions are just human-friendly wrappers for sed. So use sed directly:
sed -i "/$PATTERN/a$CONTENT" $CONFIG
You just have to be careful if $PATTERN or $CONTENT might contain any non-alphanumeric characters.
You could directly use sed.
You could also just reuse the pc_insert() code from 384.9
We use essential cookies to make this site work, and optional cookies to enhance your experience.