-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
octodns.sh
executable file
·38 lines (30 loc) · 871 Bytes
/
octodns.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
37
38
#!/usr/bin/env bash
set -e
source env.sh
source venv/bin/activate
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
CONFIG="netbox.yml"
DEBUG=
function usage()
{
cat << HEREDOC
Usage: octosync.sh [--validate] [--sync] [--doit]
optional arguments:
--debug enable debug logging
--config pass config file name
-h, --help show this help message and exit
HEREDOC
}
while [[ $# -gt 0 ]]; do
key="$1"
case "$key" in
--config) CONFIG="$2"; shift ;;
--debug) DEBUG=1; ;;
--help) usage; exit 0; ;;
--doit) octodns-sync ${DEBUG:+--debug} --config "./config/$CONFIG" ;;
--sync) octodns-sync ${DEBUG:+--debug} --config "./config/$CONFIG" ;;
--validate) octodns-validate ${DEBUG:+--debug} --config "./config/$CONFIG" ;;
*) usage; exit 0; ;;
esac
shift
done