Sizzlechest
Regular Contributor
Agreed, Here's mine:Each time you will update the firmware, all your custom scripts will be wiped out…
Best solution is to use a USB thumb drive and to have in it the script /autorun/scripts/post-mount.sh to call any script putting your customization scripts in place.
In your case either by copying it to /etc/init.d/dnsmasq from a local copy in your thumb drive or using ln -s to make a soft link of it in the /etc/init.d directory.
Bash:
#!/bin/sh
if [ ! -f "/root/firewall-start.sh" ]
then
cp /tmp/mnt/$1/firewall-start.sh /root/.
fi
if [ ! -f "/root/.ssh/authorized_keys" ]
then
mkdir -p /root/.ssh
cp /tmp/mnt/$1/authorized_keys /root/.ssh/authorized_keys
fi
if [ ! -f "/overlay/etc/dnscrypt-proxy-2.toml " ]; then
sed -i -r "s/^(server_names[[:space:]]*=[[:space:]]*).*/\1['adguard-dns-doh']/" /etc/dnscrypt-proxy-2.toml
fi
It copies my firewall-start.sh, copies my ssh keys, and edits dnscrypt-proxy to use the adguard server.