View | Details | Raw Unified | Return to bug 19048
Collapse All | Expand All

(-)univention-thin-client-rollout.o/debian/changelog (+73 lines)
Line 0    Link Here 
1
univention-thin-client-rollout (1.1.0-1) unstable; urgency=low
2
3
  * fixed ldap server detection in init script Ticket: #2011030710000906
4
5
 -- Felix Botner <botner@univention.de>  Wed, 17 Aug 2011 10:05:00 +0200
6
7
univention-thin-client-rollout (1.0.4-1) unstable; urgency=low
8
9
  * changed msg's in thin-client-rollout Ticket #2010020310000417 
10
11
 -- Felix Botner <botner@univention.de>  Thu, 23 Sep 2010 13:56:05 +0200
12
13
univention-thin-client-rollout (1.0.3-1) unstable; urgency=low
14
15
  * changed dialog color scheme Ticket #2010020310000417
16
17
 -- Felix Botner <botner@univention.de>  Thu, 23 Sep 2010 10:56:58 +0200
18
19
univention-thin-client-rollout (1.0.2-1) unstable; urgency=low
20
21
  * reboot the tc after successfully creating the udm object is now
22
    default Ticket #2010020310000417
23
24
 -- Felix Botner <botner@univention.de>  Wed, 22 Sep 2010 18:56:34 +0200
25
26
univention-thin-client-rollout (1.0.1-3) unstable; urgency=low
27
28
  * added default position Ticket #2010020310000417 
29
30
 -- Felix Botner <botner@univention.de>  Wed, 01 Sep 2010 12:45:43 +0200
31
32
univention-thin-client-rollout (1.0.1-2) unstable; urgency=low
33
34
  * fixed thin-client-rollout Ticket #2010020310000417 
35
36
 -- Felix Botner <botner@univention.de>  Wed, 01 Sep 2010 11:50:20 +0200
37
38
univention-thin-client-rollout (1.0.1-1) unstable; urgency=low
39
40
  * removed u-t-c-ucr Ticket #2010020310000417 
41
42
 -- Felix Botner <botner@univention.de>  Wed, 01 Sep 2010 10:50:28 +0200
43
44
univention-thin-client-rollout (1.0.1-0) unstable; urgency=low
45
46
  * fixed univention-thin-client-ucr-set
47
  * default for thinclient/rollout/ldapbase is $ldap_base Ticket #2010020310000417 
48
49
 -- Felix Botner <botner@univention.de>  Fri, 30 Jul 2010 14:11:16 +0200
50
51
univention-thin-client-rollout (1.0.0.4) unstable; urgency=low
52
53
  * fixed permissions of univention-thin-client-ucr-set #2010020310000417 
54
55
 -- Felix Botner <botner@univention.de>  Mon, 19 Jul 2010 16:50:06 +0200
56
57
univention-thin-client-rollout (1.0.0.3) unstable; urgency=low
58
59
  * added ucr script for pxe default configuration Ticket #2010020310000417 
60
61
 -- Felix Botner <botner@univention.de>  Mon, 19 Jul 2010 16:40:15 +0200
62
63
univention-thin-client-rollout (1.0.0.2) unstable; urgency=low
64
65
  * added tc ucr script Ticket #2010020310000417 
66
67
 -- Felix Botner <botner@univention.de>  Mon, 19 Jul 2010 14:46:26 +0200
68
69
univention-thin-client-rollout (1.0.0.1) unstable; urgency=low
70
71
  * inital release
72
73
 -- Felix Botner <botner@univention.de>  Mon, 19 Jul 2010 12:36:23 +0200
(-)univention-thin-client-rollout.o/debian/compat (+1 lines)
Line 0    Link Here 
1
5
(-)univention-thin-client-rollout.o/debian/control (+28 lines)
Line 0    Link Here 
1
Source: univention-thin-client-rollout
2
Section: univention
3
Priority: optional
4
Maintainer: Univention GmbH <packages@univention.de>
5
Build-Depends: debhelper (>> 3.0.0), univention-config-dev, univention-thin-client-tools
6
Standards-Version: 3.5.2
7
8
Package: univention-thin-client-rollout
9
Architecture: all
10
Depends: univention-thin-client-basesystem
11
Description: UCS - Easy rollout support for thin clients
12
 This package provides support for easy rollout of thin clients
13
 .
14
 It is part of Univention Corporate Server (UCS), an
15
 integrated, directory driven solution for managing
16
 corporate environments. For more information about UCS,
17
 refer to: http://www.univention.de/
18
19
Package: univention-thin-client-rollout-config
20
Architecture: all
21
Depends: dialog, univention-ssh
22
Description: UCS - Easy rollout support for thin clients
23
 This package provides configuration files for easy rollout of thin clients
24
 .
25
 It is part of Univention Corporate Server (UCS), an
26
 integrated, directory driven solution for managing
27
 corporate environments. For more information about UCS,
28
 refer to: http://www.univention.de/
(-)univention-thin-client-rollout.o/debian/copyright (+35 lines)
Line 0    Link Here 
1
Copyright 2001-2010 by
2
3
Univention GmbH
4
http://www.univention.de/
5
6
All rights reserved.
7
8
The source code of the software contained in this package
9
as well as the source package itself are made available
10
under the terms of the GNU General Public License version 2
11
(GNU GPL V2) as published by the Free Software Foundation.
12
13
Binary versions of this package provided by Univention to you as
14
well as other copyrighted, protected or trademarked materials like
15
Logos, graphics, fonts, specific documentations and configurations,
16
cryptographic keys etc. are subject to a license agreement between
17
you and Univention.
18
19
In the case you use the software under the terms of the GNU GPL V2,
20
the program is provided in the hope hat it will be useful,
21
but WITHOUT ANY WARRANTY; without even the implied warranty of
22
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
GNU General Public License for more details.
24
25
You should have received a copy of the GNU General Public License with
26
the Debian GNU/Linux or Univention distribution in file
27
/usr/share/common-licenses/GPL; if not, write to the Free Software
28
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
30
On Univention and Debian systems, the complete text of the GNU General Public
31
License, version 2, can be found in /usr/share/common-licenses/GPL-2.
32
Copyright (C) 2001-2005 Univention GmbH. All rights reserved.
33
http://www.univention.de/
34
35
(-)univention-thin-client-rollout.o/debian/dirs (+2 lines)
Line 0    Link Here 
1
var/lib/univention-client-root/thin-client-archive/rollout
2
usr/sbin
(-)univention-thin-client-rollout.o/debian/postinst (+39 lines)
Line 0    Link Here 
1
#!/bin/sh
2
#
3
# Univention Thin Client Rollout Support
4
#  postinst script for the debian package
5
#
6
# Copyright (C) 2007-2010 Univention GmbH
7
#
8
# http://www.univention.de/
9
#
10
# All rights reserved.
11
#
12
# This program is free software; you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License version 2 as
14
# published by the Free Software Foundation.
15
#
16
# Binary versions of this file provided by Univention to you as
17
# well as other copyrighted, protected or trademarked materials like
18
# Logos, graphics, fonts, specific documentations and configurations,
19
# cryptographic keys etc. are subject to a license agreement between
20
# you and Univention.
21
#
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
25
# GNU General Public License for more details.
26
#
27
# You should have received a copy of the GNU General Public License
28
# along with this program; if not, write to the Free Software
29
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA	 02110-1301	 USA
30
31
#DEBHELPER#
32
33
eval $(ucr shell)
34
35
univention-thin-client-apt install univention-thin-client-rollout-config
36
ucr set directory/manager/web/modules/computers/thinclient/properties/ip/required?0
37
univention-thin-client-ucr set thinclient/rollout/ldap/base?"$ldap_base"
38
39
exit 0
(-)univention-thin-client-rollout.o/debian/rules (+70 lines)
Line 0    Link Here 
1
#!/usr/bin/make -f
2
#
3
# Univention Thin Client Rollout support
4
#  rules file for the debian package
5
#
6
# Copyright (C) 2007-2010 Univention GmbH
7
#
8
# http://www.univention.de/
9
#
10
# All rights reserved.
11
#
12
# This program is free software; you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License version 2 as
14
# published by the Free Software Foundation.
15
#
16
# Binary versions of this file provided by Univention to you as
17
# well as other copyrighted, protected or trademarked materials like
18
# Logos, graphics, fonts, specific documentations and configurations,
19
# cryptographic keys etc. are subject to a license agreement between
20
# you and Univention.
21
#
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
25
# GNU General Public License for more details.
26
#
27
# You should have received a copy of the GNU General Public License
28
# along with this program; if not, write to the Free Software
29
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA	 02110-1301	 USA
30
31
build: build-stamp
32
build-stamp:
33
	dh_testdir
34
35
	touch build-stamp
36
37
clean:
38
	dh_testdir
39
	dh_testroot
40
41
	rm -f build-stamp configure-stamp
42
43
	rm -rf debian/tmp
44
45
	dh_clean
46
47
install: build
48
	dh_testdir
49
	dh_testroot
50
	dh_installdirs
51
	install -D -m 755 etc/init.d/thin-client-rollout debian/univention-thin-client-rollout-config/etc/init.d/thin-client-rollout
52
	univention-install-config-registry
53
	
54
	univention-thin-client-download-debs -d `pwd`/debian/univention-thin-client-rollout/var/lib/univention-client-root/thin-client-archive/rollout -p dialog univention-ssh
55
56
binary-indep: build install
57
58
binary-arch: build install
59
	dh_testdir
60
	dh_testroot
61
	dh_installdocs -Nunivention-thin-client-rollout-config
62
	dh_installchangelogs -Nunivention-thin-client-rollout-config
63
	dh_link
64
	dh_installdeb
65
	dh_gencontrol
66
	dh_md5sums
67
	dh_builddeb
68
69
binary: binary-indep binary-arch
70
.PHONY: build clean binary-indep binary-arch binary install configure
(-)univention-thin-client-rollout.o/debian/univention-thin-client-rollout-config.postinst (+35 lines)
Line 0    Link Here 
1
#!/bin/sh
2
#
3
# Univention Thin Client Rollout Support
4
#  postinst script for the debian package
5
#
6
# Copyright (C) 2007-2010 Univention GmbH
7
#
8
# http://www.univention.de/
9
#
10
# All rights reserved.
11
#
12
# This program is free software; you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License version 2 as
14
# published by the Free Software Foundation.
15
#
16
# Binary versions of this file provided by Univention to you as
17
# well as other copyrighted, protected or trademarked materials like
18
# Logos, graphics, fonts, specific documentations and configurations,
19
# cryptographic keys etc. are subject to a license agreement between
20
# you and Univention.
21
#
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
25
# GNU General Public License for more details.
26
#
27
# You should have received a copy of the GNU General Public License
28
# along with this program; if not, write to the Free Software
29
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA	 02110-1301	 USA
30
31
#DEBHELPER#
32
33
update-rc.d thin-client-rollout start 39 S .
34
35
exit 0
(-)univention-thin-client-rollout.o/debian/univention-thin-client-rollout.univention-config-registry (+3 lines)
Line 0    Link Here 
1
Type: script
2
Script: thin-client-default-pxe.py
3
Variables: pxe/*
(-)univention-thin-client-rollout.o/etc/init.d/thin-client-rollout (+199 lines)
Line 0    Link Here 
1
#!/bin/sh
2
#
3
# Univention Client Basesystem
4
#  init script: setting up network connection for thin client
5
#
6
# Copyright (C) 2006-2010 Univention GmbH
7
#
8
# http://www.univention.de/
9
#
10
# All rights reserved.
11
#
12
# This program is free software; you can redistribute it and/or modify
13
# it under the terms of the GNU General Public License version 2 as
14
# published by the Free Software Foundation.
15
#
16
# Binary versions of this file provided by Univention to you as
17
# well as other copyrighted, protected or trademarked materials like
18
# Logos, graphics, fonts, specific documentations and configurations,
19
# cryptographic keys etc. are subject to a license agreement between
20
# you and Univention.
21
#
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
25
# GNU General Public License for more details.
26
#
27
# You should have received a copy of the GNU General Public License
28
# along with this program; if not, write to the Free Software
29
30
. /lib/lsb/init-functions
31
32
echo "
33
dialog_color = (BLACK,WHITE,OFF)
34
screen_color = (WHITE,BLACK,OFF)
35
border_color = (BLACK,WHITE,OFF)
36
title_color = (RED,WHITE,OFF)
37
button_inactive_color = (RED,WHITE,OFF)
38
button_key_active_color = (WHITE,RED,OFF)
39
button_key_inactive_color = (RED,WHITE,OFF)
40
button_label_active_color = (WHITE,RED,OFF)
41
button_label_inactive_color = (RED,WHITE,OFF)
42
button_active_color = (WHITE,RED,OFF)
43
button_inactive_color = (RED,WHITE,OFF)
44
inputbox_color = (RED,WHITE,OFF)
45
use_shadow = OFF
46
" > /root/dialogrc
47
48
ramdisk="/ramdisk"
49
export DIALOGRC=/root/dialogrc
50
dialog="dialog --clear"
51
btitle='Univention Thin Client Rollout'
52
ldapServer=$(cat /proc/cmdline | grep ldapServer | sed -e 's|.*ldapServer=||;s| .*||;s|"||g')
53
size="12 70"
54
55
eval $(univention-baseconfig shell \
56
thinclient/rollout/ldap/base \
57
thinclient/rollout/ldap/bindpwfile \
58
thinclient/rollout/ldap/binduid \
59
thinclient/rollout/reboot \
60
thinclient/rollout/ldap/position)
61
62
log_action_msg "Preparing Thin Client for rollout"
63
64
# test nfs boot
65
if ! grep -iq 'root=/dev/nfs' /proc/cmdline; then
66
	log_action_end_msg 0
67
	exit 0
68
fi
69
70
# test necessary vars
71
if [ -z "$thinclient_rollout_ldap_base" -o -z "$ldapServer" ]; then
72
	log_action_end_msg 0
73
	exit 0
74
fi
75
76
# search mac address
77
mymac=$(cat /sys/class/net/eth0/address)
78
79
# password
80
if [ -n "$thinclient_rollout_ldap_bindpwfile" -a -f "$thinclient_rollout_ldap_bindpwfile" ]; then
81
	password=$(cat $thinclient_rollout_ldap_bindpwfile)
82
fi
83
84
uid="$thinclient_rollout_ldap_binduid"
85
position="$thinclient_rollout_ldap_position"
86
87
# default position
88
if [ -z "$position" ]; then
89
        position="cn=computers,$thinclient_rollout_ldap_base"
90
fi
91
92
# dialog
93
while true; do
94
95
	# mac found -> normal boot 
96
	if ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" macAddress="$mymac" | \
97
		ldapsearch-wrapper | grep ^macAddress:; then
98
		log_action_end_msg 0
99
		exit 0
100
	fi
101
102
	# stop usplash
103
	usplash_write "QUIT"
104
	clear
105
106
	# check errors
107
	if [ -n "$errorMsg" ]; then
108
		$dialog --backtitle "$btitle" \
109
			--title " Error while creating UCS Thin Client " --msgbox "\n$errorMsg" $size 
110
		errorMsg=""
111
	fi
112
113
	# get infos
114
	ask=3
115
	title=" Create UCS Thin Client object "
116
	while [ $ask -eq 3 ]; do
117
		name=$($dialog --backtitle "$btitle" --title "$title" --no-cancel \
118
			--inputbox "\nName for the UCS Thin Client:" $size "$name" 3>&1 1>&2 2>&3)
119
		uid=$($dialog --backtitle "$btitle" --no-cancel \
120
			--title "$title" --inputbox "\nName of an user with administrative rights:" \
121
			$size "$uid" 3>&1 1>&2 2>&3)
122
		password=$($dialog --backtitle "$btitle" --no-cancel \
123
			--title "$title" --insecure \
124
			--passwordbox "\nPassword for user with administrative rights:" \
125
			$size "$password" 3>&1 1>&2 2>&3)
126
		position=$($dialog --backtitle "$btitle" --no-cancel \
127
			--title "$title" --inputbox "\nLDAP position for the UCS Thin Client object:" \
128
			$size "$position" 3>&1 1>&2 2>&3)
129
130
		$dialog --backtitle "$btitle" --title "$title" --extra-button \
131
			--extra-label "Reenter" --yesno \
132
			"\nSettings:\n \
133
			\nName of UCS Thin Client: $name \
134
			\nUser for creation:       $uid \
135
			\nLDAP Position:           $position \
136
			\nLDAP Server:             $ldapServer" $size
137
138
		ask=$?
139
140
		# cancel
141
		if [ $ask -eq 1 ]; then
142
			exit 0
143
		fi
144
145
		if [ -z "$name" -o -z "$password" -o -z "$uid" ]; then
146
			ask=3
147
		fi
148
	done
149
150
	# test name
151
	object=$(ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" \
152
		"(&(objectClass=univentionHost)(cn=$name))" dn | ldapsearch-wrapper | grep ^dn:)
153
	if [ -n "$object" ]; then 
154
		errorMsg="Name already exists!"
155
		object=""
156
		continue
157
	fi
158
	
159
	# get ldap dn
160
	userDn=$(ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" \
161
		uid="$uid" dn | ldapsearch-wrapper | grep ^dn: | awk -F ": " {'print $2'})
162
	if [ -z "$userDn" ]; then
163
		errorMsg="Could not get LDAP DN for UID $uid!"
164
		continue
165
	fi
166
167
	pwfile=$(mktemp)
168
	echo "$password" > "$pwfile"
169
170
	clear 
171
172
	# run udm
173
	cmd="/usr/sbin/udm computers/thinclient create --binddn \\\"$userDn\\\" --bindpwd \\\"$password\\\""
174
	if [ -n "$position" ]; then
175
		cmd="$cmd --position \\\"$position\\\""
176
	fi
177
	cmd="$cmd --set name=\\\"$name\\\" --set mac=\\\"$mymac\\\""
178
	errorMsg=$(univention-ssh "$pwfile" "$uid"@"$ldapServer" "$cmd")
179
	rm "$pwfile"
180
	
181
	# test if object was created
182
	sleep 1
183
	object=$(ldapsearch -h "$ldapServer" -b "$thinclient_rollout_ldap_base" -x macAddress="$mymac" dn | ldapsearch-wrapper | grep ^dn:)
184
185
	if [ -n "$object" ]; then
186
		log_begin_msg "$object successfully created"
187
		log_end_msg 0
188
		object=""
189
190
		if [ -n "$thinclient_rollout_reboot" -a "$thinclient_rollout_reboot" = "no" ]; then
191
			log_begin_msg "reboot disabled via thinclient/rollout/reboot"
192
			log_end_msg 0
193
		else
194
			reboot
195
		fi
196
		exit 0
197
	fi
198
199
done	
(-)univention-thin-client-rollout.o/thin-client-default-pxe.py (+57 lines)
Line 0    Link Here 
1
#!/usr/bin/python2.4
2
# -*- coding: utf-8 -*-
3
#
4
# Univention thin client default pxe
5
#  bootsplash script
6
#
7
# Copyright (C) 2004-2010 Univention GmbH
8
#
9
# http://www.univention.de/
10
#
11
# All rights reserved.
12
#
13
# This program is free software; you can redistribute it and/or modify
14
# it under the terms of the GNU General Public License version 2 as
15
# published by the Free Software Foundation.
16
#
17
# Binary versions of this file provided by Univention to you as
18
# well as other copyrighted, protected or trademarked materials like
19
# Logos, graphics, fonts, specific documentations and configurations,
20
# cryptographic keys etc. are subject to a license agreement between
21
# you and Univention.
22
#
23
# This program is distributed in the hope that it will be useful,
24
# but WITHOUT ANY WARRANTY; without even the implied warranty of
25
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
# GNU General Public License for more details.
27
#
28
# You should have received a copy of the GNU General Public License
29
# along with this program; if not, write to the Free Software
30
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
31
32
import os
33
import shutil
34
import sys
35
import univention.config_registry
36
37
cr = univention.config_registry.ConfigRegistry()
38
cr.load()
39
default = "/var/lib/univention-client-boot/pxelinux.cfg/default"
40
defaultNet = "/etc/univention/client-boot-pxe/pxeconfig"
41
defaultLocal = "/etc/univention/client-boot-pxe/pxeconfig.local"
42
43
cfg = cr.get("pxe/default", "local")
44
45
if not os.path.isfile(default) or not os.path.isfile(defaultNet):
46
	sys.exit(0)
47
48
# save local pxe config
49
if not os.path.isfile(defaultLocal):
50
	shutil.copyfile(default, defaultLocal)
51
52
if cfg == "local":
53
	shutil.copyfile(defaultLocal, default)
54
55
if cfg == "net":
56
	shutil.copyfile(defaultNet, default)
57

Return to bug 19048