#!/bin/bash # Get User password USER_PASSWD=$(cat $1) logger -t "zero-init-network-users[$$]" "llxcfg-cpkg update" llxcfg-cpkg update # Inicialize LDAP Database logger -t "zero-init-network-users[$$]" "llxcfg-ldap --force init" llxcfg-ldap --force init logger -t "zero-init-network-users[$$]" "nfs-server restart" llxcfg-cpkg invoke restart nfs-server &>/dev/null || true # Inicialize Kerberos logger -t "zero-init-network-users[$$]" "llxcfg-krb5 --force init" llxcfg-krb5 --force init # Set password of User in Kerberos logger -t "zero-init-network-users[$$]" "Setting passwords for doquier" echo -e "${USER_PASSWD}\n${USER_PASSWD}" | llxcfg-krb5 addprinc ${SUDO_USER} &>/dev/null # Now Fix the Password for if the flies echo -e "${USER_PASSWD}\n${USER_PASSWD}" | llxcfg-krb5 passwd ${SUDO_USER} &>/dev/null llxcfg-ldap passwd ${SUDO_USER} $USER_PASSWD echo -e "${USER_PASSWD}\n${USER_PASSWD}" | passwd ${SUDO_USER} &>/dev/null logger -t "zero-init-network-users[$$]" "Restart n4d server" service n4d restart zero-sqlmanager -s zero-network-users 1 exit 0