commit
5ce650fe17
15
README.md
15
README.md
@ -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
|
||||
@ -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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
# nsupdate.config
|
||||
|
||||
# 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="YES"
|
||||
@ -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
nsupdate.sh
16
nsupdate.sh
@ -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
|
||||
@ -102,4 +116,4 @@ do
|
||||
unset INWX_PASS
|
||||
unset INWX_USER
|
||||
unset INWX_DOMAIN_ID
|
||||
done
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user