commit
5ce650fe17
13
README.md
13
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
|
||||
|
@ -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
nsupdate.sh
14
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user