#!/bin/bash if [[ $# -ne 3 ]]; then echo "Usage: $0 name ip mac" exit 0 fi NAME="$1" IP="$2" MAC="$3" DOMAIN=$(ucr get domainname) DC=$(ucr get ldap/base) univention-directory-manager dhcp/host create \ --superordinate "cn=$DOMAIN,cn=dhcp,$DC" \ --set host="$NAME" \ --set fixedaddress="$IP" \ --set hwaddress="ethernet $MAC"