This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /usr/share/foreman/config/hooks.d/lib/utils.sh | |
. $FOREMAN_HOME/config/hooks.d/lib/hook_functions.sh | |
set -x | |
IP=$(hook_data host.ip) | |
DNSNAME=$(hook_data host.name) | |
REVERSE=$(reverseIp ${IP}) | |
rdns_create() { | |
echolog IP ${IP} calling nsupdate: dns3.server.name update add ${REVERSE}.in-addr.arpa. 86400 PTR $DNSNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export FOREMAN_SERVER=$foremanserver/api | |
export FOREMAN_USER=apiuser | |
export FOREMAN_PASSWORD=$password | |
export FOREMAN_HOME=/usr/share/foreman | |
export PATH=$PATH:/usr/local/bin | |
reverseIp() { | |
local a i n | |
IFS=. read -r -a a <<< "$1" |