What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Problems with dnsmasq scripts and manual configuration

I’ll give one last shot at a direct question in hope of a direct answer. Do both of your postconf scripts start with this exact line:
Code:
#!/bin/sh
Is the exclamation point there?
 
I’ll give one last shot at a direct question in hope of a direct answer. Do both of your postconf scripts start with this exact line:
Code:
#!/bin/sh
Is the exclamation point there?
Cute. I still haven't figured out how you do those system file names without that nagging error message so I will go on using DOS notation to post. Yes it is correct in the original! Whether that is essential varies by *ix system although I have never seen one that didn't have a default shell, but at best there is only the ash shell which does not really require it in any *wrt firmware. See below. As mentioned the copy paste and editing for brevity might have introduced noise. Besides using DOS notation, the extra comments and cat here document provided in file comments were removed. Here's the full script in all detail which by design releases no network confidential data and is meant to support maintainers including myself months or years later when such details have passed out of mind


!\sh\bin

CONFIG=$1 # not really set to config file (empty)
CONFIGLAND="\ffs\configs"
SCRIPTLAND="\jffs\scripts"
TARGET="\etc\hosts" # really \tmp\etc\hosts

LOCALDNSCONFIGS="$CONFIGLAND/dnsmasq.localdomains.conf"

touch \jffs\hostpost.flag #debugging

# $CONFIG script to modify (append to) and $TARGET just after creation

# Shell source global (immuntable) for used here and other dnsmasq-SDN.conf.add, and hosts.postconf scripts:
# Format: Main_LAN_Domain SDN_1_DNS_IP SDN_1_Hostname SDN_2_DNS_IP SDN_2_Hostname … the separator is " " (empty space)DNSMASQ
#
# Note: additional configurations must match consistently with GUI definitions and $LOCALDNSCONFIGS definitions in $CONFIGLAND and $SCRIPTLAND
# done this way to avoid strange start and restart scenarios after hopefully a full reconfiguration from scratch by DNSMASQ and possibly YAZDhcp

. "$LOCALDNSCONFIGS" #Brings in DNSMASQDOMAINS


cat >>$TARGET << EOF
#
# Added by hosts.postconfig to expand scope of dnsmask domains for Guest Pro Vlans making the chosen Vlan DNS names visible to main LAN
#
EOF




----------------------------- testing !\bin\sh necessity in ash shell in asuswrt_Merlin-------------------------

>cat abc
echo hello
echo world
>chmod a+rx abc
> ./abc
hello
world
 
I still haven't figured out how you do those system file names without that nagging error message
I use the code block icon when posting.
1758732803181.png
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top