File: oci-dns-create-host

package info (click to toggle)
openstack-cluster-installer 43.0.22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,544 kB
  • sloc: php: 19,169; sh: 18,137; ruby: 75; makefile: 31; xml: 8
file content (38 lines) | stat: -rwxr-xr-x 519 bytes parent folder | download | duplicates (8)
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
#!/bin/sh

set -e
set -x

usage () {
	echo "Usage: $0 --hostname <HOSTNAME> --ip-address <IP_ADDRESS>"
	exit 1
}

for i in $@ ; do
	case "${1}" in
	"--hostname")
		HOSTNAME=${2}
		shift
		shift
	;;
	"--ip-address")
		IP_ADDRESS=${2}
		shift
		shift
	;;
	*)
	;;
	esac
done

if [ -z "${HOSTNAME}" ] ; then
	usage
fi

if [ -z "${IP_ADDRESS}" ] ; then
	usage
fi

# Example calls:
# ssh ONE_HOSTNAME "dns-command add-record ${HOSTNAME} ${IP_ADDRESS}"
# curl https://example.com/dns-api/create-host/${HOSTNAME}/${IP_ADDRESS}