What's new

Can I execute ddns-start as bash instead of sh?

  • 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!

untarded

New Around Here
I'm attempting to modify an existing bash script to create a custom ddns-start script for DigitalOcean. Since it's written in bash (and also includes arrays) i'm finding that translating it is proving more difficult than I anticipated, especially considering I'm a linux novice.

So is it possible to execute this script as bash script?
 
Bash is not included by default, but you can use Entware to install it.

Be aware that bash is much more complex (than Ash/Dash or whatever busybox uses) and therefore harder to secure. (Shellshock bug)
 
I'm attempting to modify an existing bash script to create a custom ddns-start script for DigitalOcean. Since it's written in bash (and also includes arrays) i'm finding that translating it is proving more difficult than I anticipated, especially considering I'm a linux novice.

So is it possible to execute this script as bash script?

you could install bash but that's probably overkill. I'm guessing you're using this script https://github.com/fatbattk/DigitalOceanDynDNS

I forked it and made some edits to make it compatible with the Busybox shell that's available on Asuswrt-Merlin.
https://github.com/deekue/DigitalOceanDynDNS

I don't have a DO account to test it with but Busybox doesn't choke on it. Give it a try and let me know how it goes.

I'll send the author a pull request too
 
yes, that was the script i started with.

After working with it for a while though i felt the the subsequent calls to retrieve and loop all dns records was wasteful for my intended purpose and simply made the call to list records manually and recorded the the particular record i wanted to maintain. I wrote a more abbreviated script and documented it here:

http://forums.smallnetbuilder.com/showthread.php?t=22916
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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