Update duia-bash.sh

- removed some code repetition
- added the possibility to define the cache filename (the path)
- added the possibility to choose the IP version to use
- added a check for cache file content after it has been set

Tested on a raspberry
Merge pull request #1 from stesix/patch-1

Update duia-bash.sh