-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdyndns.sh
executable file
·36 lines (25 loc) · 900 Bytes
/
dyndns.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
#########################################################################
# This script updates the dyndns entry and saves a small log #
# ---------------------------------------------------------- #
# usage: see README.md #
# ---------------------------------------------------------- #
# this work is licensed under a cc by nc sa 4.0 license #
# more informations: https://github.com/sedrubal/dyndns-refresh #
#########################################################################
#########################
# config: #
#########################
configfile='config.cfg'
source "$(dirname $0)/$configfile"
#########################
# update state #
#########################
status="$(curl -s -L ${url})"
# log results and exit
if [[ ! -z $1 && "$1" -eq "-v" ]] ; then
echo "${status}"
fi
exec "${loggerpath}" -f "${logfile}" "dyndns-refresh: $status"
exit 0