to this
server=$(pdnsd-ctl status|sed -ne '/^Global:$/,/^Server.*:$/s/.*Server ip.*: \(.*\)$/\1/ip')
in both scripts, it now works fine.
This is because the way of pdnsd-ctl status reports server ip, now it do that with the word "ip" capitalized:
Global:
-------
Cache size: 2048 kB
Server directory: /var/cache/pdnsd
Scheme file (for Linux pcmcia support): /var/lib/pcmcia/scheme
Server port: 53
Server IP (0.0.0.0=any available one): 127.0.1.1
instead of:
Global:
-------
Cache size: 2048 kB
Server directory: /var/cache/pdnsd
Scheme file (for Linux pcmcia support): /var/lib/pcmcia/scheme
Server port: 53
Server ip (0.0.0.0=any available one): 127.0.1.1
I hope it actually helps.