Merge pull request #8 from OranJuiceJohnes/master

New Pull Request
This commit is contained in:
Christian Busch 2015-01-12 18:37:53 +01:00
commit 5ce650fe17
3 changed files with 31 additions and 4 deletions

View File

@ -6,8 +6,21 @@ nsbackup is a bash script that uses curl and the inwx API to update nameserver e
Place your config files in the _nsupdate.d_ folder. Place your config files in the _nsupdate.d_ folder.
## Requirements
In order to run you need to have _curl_ and _awk_ installed, as well as _drill_ or _nslookup_.
At least one config file needs to exist ending with _.config_. A "sample.config.dist" is provided.
## Changelog ## Changelog
**2015-01-12**
- Added checking for needed commands
- Added checking for existing config file
- Added requirements to README.md
**2014-02-21** **2014-02-21**
- Added support for IPv6 - Added support for IPv6

View File

@ -1,7 +1,7 @@
# nsupdate.config # nsupdate.config
# from which site should we get your wan ip? # from which site should we get your wan ip?
IP_CHECK_SITE="http://ip.dblx.io" IP_CHECK_SITE="https://ip.dblx.io"
# use drill instead of nslookup for hostname lookup # use drill instead of nslookup for hostname lookup
USE_DRILL="YES" USE_DRILL="YES"

View File

@ -24,6 +24,20 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##################
# check required #
##################
command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Note: all needed items are listed in the README.md file."; exit 1; }
command -v awk >/dev/null 2>&1 || { echo >&2 "I require awk but it's not installed. Note: all needed items are listed in the README.md file."; exit 1; }
command -v drill >/dev/null 2>&1 || command -v nslookup >/dev/null 2>&1 || { echo >&2 "I need drill or nslookup installed. Note: all needed items are listed in the README.md file."; exit 1; }
##################
# check config #
##################
if [ ! -f nsupdate.d/*.config ]; then
echo "There does not seem to be ready to be used config file available." ; exit 1;
fi
##################
LOG=$0.log LOG=$0.log
# Loop through configs # Loop through configs