Lines 36-42
log_error () { # Log error message and exit
|
Link Here
|
---|
|
36 |
local message="Error: $@" |
36 |
local message="Error: $@" |
37 |
echo $message |
37 |
echo $message |
38 |
echo $message >>"$LOG_FILE" |
38 |
echo $message >>"$LOG_FILE" |
39 |
exit 1 |
|
|
40 |
} |
39 |
} |
41 |
log_warn () { # Log warning message |
40 |
log_warn () { # Log warning message |
42 |
local message="Warning: $@" |
41 |
local message="Warning: $@" |
Lines 47-75
log_warn () { # Log warning message
|
Link Here
|
---|
|
47 |
echo "Start $0 at $(date)" >>"$LOG_FILE" |
46 |
echo "Start $0 at $(date)" >>"$LOG_FILE" |
48 |
eval "$(univention-config-registry shell)" |
47 |
eval "$(univention-config-registry shell)" |
49 |
|
48 |
|
50 |
if [ ! -e /etc/machine.secret ]; then |
|
|
51 |
log_error "/etc/machine.secret not found" |
52 |
fi |
53 |
|
54 |
if ! ldapsearch -x -h "$ldap_master" -p "$ldap_master_port" -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
55 |
then |
56 |
log_error "ldapsearch -x failed" |
57 |
fi |
58 |
|
59 |
|
60 |
if ! ldapsearch -x -ZZ -h "$ldap_master" -p "$ldap_master_port" -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
61 |
then |
62 |
log_error "ldapsearch -x -ZZ failed" |
63 |
fi |
64 |
|
65 |
if [ ! -e /var/univention-join/joined ] |
49 |
if [ ! -e /var/univention-join/joined ] |
66 |
then |
50 |
then |
67 |
log_error "The system isn't joined yet" |
51 |
log_error "The system isn't joined yet" |
68 |
fi |
52 |
fi |
69 |
|
53 |
|
70 |
if ! ldapsearch -x -ZZ -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
54 |
if [ ! -e /etc/machine.secret ]; then |
71 |
then |
55 |
log_error "/etc/machine.secret not found" |
72 |
log_error "localhost ldapsearch failed" |
56 |
else |
|
|
57 |
if ! ldapsearch -x -h "$ldap_master" -p "$ldap_master_port" -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
58 |
then |
59 |
log_error "ldapsearch -x failed" |
60 |
elif ! ldapsearch -x -ZZ -h "$ldap_master" -p "$ldap_master_port" -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
61 |
then |
62 |
log_error "ldapsearch -x -ZZ failed" |
63 |
fi |
64 |
|
65 |
if ! ldapsearch -x -ZZ -D "$ldap_hostdn" -w "$(</etc/machine.secret)" -b "$ldap_base" -s base >>"$LOG_FILE" 2>&1 |
66 |
then |
67 |
log_error "localhost ldapsearch failed" |
68 |
fi |
73 |
fi |
69 |
fi |
74 |
|
70 |
|
75 |
LC_COLLATE="C" |
71 |
LC_COLLATE="C" |