#!/bin/sh

if [ ! "$1" ]; then
    echo "Usage: $0 <vhost>"
    exit 2
fi

exec ldapvi --bind sasl -Y GSSAPI -h scripts-ldap-1.mit.edu -b dc=scripts,dc=mit,dc=edu \
       "(&(objectClass=scriptsVhost)(|$(printf '(scriptsVhostName=%s)' "$@")$(printf '(scriptsVhostAlias=%s)' "$@")))"
