Commit 4e4f4971 authored by Vitaly Lipatov's avatar Vitaly Lipatov

tune_ssshd.sh: add support for run with Admin name as arg

parent 3d70b84f
#!/bin/sh
# Use: ./tune_sssd.sh [AdminUser] [REALM]
fatal()
{
echo "$@" >&2
......@@ -9,6 +11,12 @@ fatal()
epm -q etckeeper || fatal "Install etckeeper for /etc/ before"
[ -d /etc/.git ] || fatal "initialize /etc with etckeeper init"
ADMIN=Administrator
if [ -n "$1" ] ; then
ADMIN="$1"
shift
fi
# Get REALM (needed for sssd tuning only) from DNS
REALM=$(host -t txt _kerberos | sed -e 's|.*"\(.*\)".*|\1|')
if [ -z "$REALM" ] ; then
......@@ -21,6 +29,7 @@ if [ -z "$REALM" ] ; then
fi
echo "Use REALM $REALM ..."
case $(distr_info -d) in
Ubuntu|Debian)
# Ubuntu
......@@ -131,7 +140,7 @@ fi
# Вход в домен
rm -fv /etc/krb5.keytab
kinit Administrator || exit
kinit $ADMIN || exit
echo "Join to domain... "
net ads join -k || exit
kdestroy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment