Skip to content

Commit

Permalink
Merge pull request #8 from OranJuiceJohnes/master
Browse files Browse the repository at this point in the history
New Pull Request
  • Loading branch information
chrisb86 committed Jan 12, 2015
2 parents da10330 + e904633 commit 5ce650f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## 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

**2015-01-12**

- Added checking for needed commands
- Added checking for existing config file
- Added requirements to README.md


**2014-02-21**

- Added support for IPv6
Expand Down Expand Up @@ -38,4 +51,4 @@ nsupdate is distributed under the MIT license, which is similar in effect to the
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 2 additions & 2 deletions nsupdate.d/sample.config.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# nsupdate.config

# from which site should we get your wan ip?
IP_CHECK_SITE="http:https://ip.dblx.io"
IP_CHECK_SITE="https:https://ip.dblx.io"

# use drill instead of nslookup for hostname lookup
USE_DRILL="YES"
Expand All @@ -14,4 +14,4 @@ INWX_PASS="PASSWORD"
# The hostname that you want to update and it's ID from the inwx interface
# You get the ID when you edit the given nameserver entry and hover the save button.
DOMAIN="DOMAIN"
INWX_DOMAIN_ID="123456789"
INWX_DOMAIN_ID="123456789"
16 changes: 15 additions & 1 deletion nsupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# 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

# Loop through configs
Expand Down Expand Up @@ -102,4 +116,4 @@ do
unset INWX_PASS
unset INWX_USER
unset INWX_DOMAIN_ID
done
done

0 comments on commit 5ce650f

Please sign in to comment.