diff -Nur univention-thin-client-rollout.o/debian/changelog univention-thin-client-rollout/debian/changelog --- univention-thin-client-rollout.o/debian/changelog 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/changelog 2011-08-17 10:06:05.722522404 +0200 @@ -0,0 +1,73 @@ +univention-thin-client-rollout (1.1.0-1) unstable; urgency=low + + * fixed ldap server detection in init script Ticket: #2011030710000906 + + -- Felix Botner Wed, 17 Aug 2011 10:05:00 +0200 + +univention-thin-client-rollout (1.0.4-1) unstable; urgency=low + + * changed msg's in thin-client-rollout Ticket #2010020310000417 + + -- Felix Botner Thu, 23 Sep 2010 13:56:05 +0200 + +univention-thin-client-rollout (1.0.3-1) unstable; urgency=low + + * changed dialog color scheme Ticket #2010020310000417 + + -- Felix Botner Thu, 23 Sep 2010 10:56:58 +0200 + +univention-thin-client-rollout (1.0.2-1) unstable; urgency=low + + * reboot the tc after successfully creating the udm object is now + default Ticket #2010020310000417 + + -- Felix Botner Wed, 22 Sep 2010 18:56:34 +0200 + +univention-thin-client-rollout (1.0.1-3) unstable; urgency=low + + * added default position Ticket #2010020310000417 + + -- Felix Botner Wed, 01 Sep 2010 12:45:43 +0200 + +univention-thin-client-rollout (1.0.1-2) unstable; urgency=low + + * fixed thin-client-rollout Ticket #2010020310000417 + + -- Felix Botner Wed, 01 Sep 2010 11:50:20 +0200 + +univention-thin-client-rollout (1.0.1-1) unstable; urgency=low + + * removed u-t-c-ucr Ticket #2010020310000417 + + -- Felix Botner Wed, 01 Sep 2010 10:50:28 +0200 + +univention-thin-client-rollout (1.0.1-0) unstable; urgency=low + + * fixed univention-thin-client-ucr-set + * default for thinclient/rollout/ldapbase is $ldap_base Ticket #2010020310000417 + + -- Felix Botner Fri, 30 Jul 2010 14:11:16 +0200 + +univention-thin-client-rollout (1.0.0.4) unstable; urgency=low + + * fixed permissions of univention-thin-client-ucr-set #2010020310000417 + + -- Felix Botner Mon, 19 Jul 2010 16:50:06 +0200 + +univention-thin-client-rollout (1.0.0.3) unstable; urgency=low + + * added ucr script for pxe default configuration Ticket #2010020310000417 + + -- Felix Botner Mon, 19 Jul 2010 16:40:15 +0200 + +univention-thin-client-rollout (1.0.0.2) unstable; urgency=low + + * added tc ucr script Ticket #2010020310000417 + + -- Felix Botner Mon, 19 Jul 2010 14:46:26 +0200 + +univention-thin-client-rollout (1.0.0.1) unstable; urgency=low + + * inital release + + -- Felix Botner Mon, 19 Jul 2010 12:36:23 +0200 diff -Nur univention-thin-client-rollout.o/debian/compat univention-thin-client-rollout/debian/compat --- univention-thin-client-rollout.o/debian/compat 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/compat 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1 @@ +5 diff -Nur univention-thin-client-rollout.o/debian/control univention-thin-client-rollout/debian/control --- univention-thin-client-rollout.o/debian/control 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/control 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,28 @@ +Source: univention-thin-client-rollout +Section: univention +Priority: optional +Maintainer: Univention GmbH +Build-Depends: debhelper (>> 3.0.0), univention-config-dev, univention-thin-client-tools +Standards-Version: 3.5.2 + +Package: univention-thin-client-rollout +Architecture: all +Depends: univention-thin-client-basesystem +Description: UCS - Easy rollout support for thin clients + This package provides support for easy rollout of thin clients + . + It is part of Univention Corporate Server (UCS), an + integrated, directory driven solution for managing + corporate environments. For more information about UCS, + refer to: http://www.univention.de/ + +Package: univention-thin-client-rollout-config +Architecture: all +Depends: dialog, univention-ssh +Description: UCS - Easy rollout support for thin clients + This package provides configuration files for easy rollout of thin clients + . + It is part of Univention Corporate Server (UCS), an + integrated, directory driven solution for managing + corporate environments. For more information about UCS, + refer to: http://www.univention.de/ diff -Nur univention-thin-client-rollout.o/debian/copyright univention-thin-client-rollout/debian/copyright --- univention-thin-client-rollout.o/debian/copyright 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/copyright 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,35 @@ +Copyright 2001-2010 by + +Univention GmbH +http://www.univention.de/ + +All rights reserved. + +The source code of the software contained in this package +as well as the source package itself are made available +under the terms of the GNU General Public License version 2 +(GNU GPL V2) as published by the Free Software Foundation. + +Binary versions of this package provided by Univention to you as +well as other copyrighted, protected or trademarked materials like +Logos, graphics, fonts, specific documentations and configurations, +cryptographic keys etc. are subject to a license agreement between +you and Univention. + +In the case you use the software under the terms of the GNU GPL V2, +the program is provided in the hope hat it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License with +the Debian GNU/Linux or Univention distribution in file +/usr/share/common-licenses/GPL; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +On Univention and Debian systems, the complete text of the GNU General Public +License, version 2, can be found in /usr/share/common-licenses/GPL-2. +Copyright (C) 2001-2005 Univention GmbH. All rights reserved. +http://www.univention.de/ + + diff -Nur univention-thin-client-rollout.o/debian/dirs univention-thin-client-rollout/debian/dirs --- univention-thin-client-rollout.o/debian/dirs 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/dirs 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,2 @@ +var/lib/univention-client-root/thin-client-archive/rollout +usr/sbin diff -Nur univention-thin-client-rollout.o/debian/postinst univention-thin-client-rollout/debian/postinst --- univention-thin-client-rollout.o/debian/postinst 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/postinst 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Univention Thin Client Rollout Support +# postinst script for the debian package +# +# Copyright (C) 2007-2010 Univention GmbH +# +# http://www.univention.de/ +# +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# Binary versions of this file provided by Univention to you as +# well as other copyrighted, protected or trademarked materials like +# Logos, graphics, fonts, specific documentations and configurations, +# cryptographic keys etc. are subject to a license agreement between +# you and Univention. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#DEBHELPER# + +eval $(ucr shell) + +univention-thin-client-apt install univention-thin-client-rollout-config +ucr set directory/manager/web/modules/computers/thinclient/properties/ip/required?0 +univention-thin-client-ucr set thinclient/rollout/ldap/base?"$ldap_base" + +exit 0 diff -Nur univention-thin-client-rollout.o/debian/rules univention-thin-client-rollout/debian/rules --- univention-thin-client-rollout.o/debian/rules 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/rules 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,70 @@ +#!/usr/bin/make -f +# +# Univention Thin Client Rollout support +# rules file for the debian package +# +# Copyright (C) 2007-2010 Univention GmbH +# +# http://www.univention.de/ +# +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# Binary versions of this file provided by Univention to you as +# well as other copyrighted, protected or trademarked materials like +# Logos, graphics, fonts, specific documentations and configurations, +# cryptographic keys etc. are subject to a license agreement between +# you and Univention. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +build: build-stamp +build-stamp: + dh_testdir + + touch build-stamp + +clean: + dh_testdir + dh_testroot + + rm -f build-stamp configure-stamp + + rm -rf debian/tmp + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_installdirs + install -D -m 755 etc/init.d/thin-client-rollout debian/univention-thin-client-rollout-config/etc/init.d/thin-client-rollout + univention-install-config-registry + + 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 + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs -Nunivention-thin-client-rollout-config + dh_installchangelogs -Nunivention-thin-client-rollout-config + dh_link + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff -Nur univention-thin-client-rollout.o/debian/univention-thin-client-rollout-config.postinst univention-thin-client-rollout/debian/univention-thin-client-rollout-config.postinst --- univention-thin-client-rollout.o/debian/univention-thin-client-rollout-config.postinst 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/univention-thin-client-rollout-config.postinst 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,35 @@ +#!/bin/sh +# +# Univention Thin Client Rollout Support +# postinst script for the debian package +# +# Copyright (C) 2007-2010 Univention GmbH +# +# http://www.univention.de/ +# +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# Binary versions of this file provided by Univention to you as +# well as other copyrighted, protected or trademarked materials like +# Logos, graphics, fonts, specific documentations and configurations, +# cryptographic keys etc. are subject to a license agreement between +# you and Univention. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#DEBHELPER# + +update-rc.d thin-client-rollout start 39 S . + +exit 0 diff -Nur univention-thin-client-rollout.o/debian/univention-thin-client-rollout.univention-config-registry univention-thin-client-rollout/debian/univention-thin-client-rollout.univention-config-registry --- univention-thin-client-rollout.o/debian/univention-thin-client-rollout.univention-config-registry 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/debian/univention-thin-client-rollout.univention-config-registry 2011-08-17 10:01:33.218522843 +0200 @@ -0,0 +1,3 @@ +Type: script +Script: thin-client-default-pxe.py +Variables: pxe/* diff -Nur univention-thin-client-rollout.o/etc/init.d/thin-client-rollout univention-thin-client-rollout/etc/init.d/thin-client-rollout --- univention-thin-client-rollout.o/etc/init.d/thin-client-rollout 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/etc/init.d/thin-client-rollout 2011-08-17 10:03:30.674098717 +0200 @@ -0,0 +1,199 @@ +#!/bin/sh +# +# Univention Client Basesystem +# init script: setting up network connection for thin client +# +# Copyright (C) 2006-2010 Univention GmbH +# +# http://www.univention.de/ +# +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# Binary versions of this file provided by Univention to you as +# well as other copyrighted, protected or trademarked materials like +# Logos, graphics, fonts, specific documentations and configurations, +# cryptographic keys etc. are subject to a license agreement between +# you and Univention. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software + +. /lib/lsb/init-functions + +echo " +dialog_color = (BLACK,WHITE,OFF) +screen_color = (WHITE,BLACK,OFF) +border_color = (BLACK,WHITE,OFF) +title_color = (RED,WHITE,OFF) +button_inactive_color = (RED,WHITE,OFF) +button_key_active_color = (WHITE,RED,OFF) +button_key_inactive_color = (RED,WHITE,OFF) +button_label_active_color = (WHITE,RED,OFF) +button_label_inactive_color = (RED,WHITE,OFF) +button_active_color = (WHITE,RED,OFF) +button_inactive_color = (RED,WHITE,OFF) +inputbox_color = (RED,WHITE,OFF) +use_shadow = OFF +" > /root/dialogrc + +ramdisk="/ramdisk" +export DIALOGRC=/root/dialogrc +dialog="dialog --clear" +btitle='Univention Thin Client Rollout' +ldapServer=$(cat /proc/cmdline | grep ldapServer | sed -e 's|.*ldapServer=||;s| .*||;s|"||g') +size="12 70" + +eval $(univention-baseconfig shell \ +thinclient/rollout/ldap/base \ +thinclient/rollout/ldap/bindpwfile \ +thinclient/rollout/ldap/binduid \ +thinclient/rollout/reboot \ +thinclient/rollout/ldap/position) + +log_action_msg "Preparing Thin Client for rollout" + +# test nfs boot +if ! grep -iq 'root=/dev/nfs' /proc/cmdline; then + log_action_end_msg 0 + exit 0 +fi + +# test necessary vars +if [ -z "$thinclient_rollout_ldap_base" -o -z "$ldapServer" ]; then + log_action_end_msg 0 + exit 0 +fi + +# search mac address +mymac=$(cat /sys/class/net/eth0/address) + +# password +if [ -n "$thinclient_rollout_ldap_bindpwfile" -a -f "$thinclient_rollout_ldap_bindpwfile" ]; then + password=$(cat $thinclient_rollout_ldap_bindpwfile) +fi + +uid="$thinclient_rollout_ldap_binduid" +position="$thinclient_rollout_ldap_position" + +# default position +if [ -z "$position" ]; then + position="cn=computers,$thinclient_rollout_ldap_base" +fi + +# dialog +while true; do + + # mac found -> normal boot + if ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" macAddress="$mymac" | \ + ldapsearch-wrapper | grep ^macAddress:; then + log_action_end_msg 0 + exit 0 + fi + + # stop usplash + usplash_write "QUIT" + clear + + # check errors + if [ -n "$errorMsg" ]; then + $dialog --backtitle "$btitle" \ + --title " Error while creating UCS Thin Client " --msgbox "\n$errorMsg" $size + errorMsg="" + fi + + # get infos + ask=3 + title=" Create UCS Thin Client object " + while [ $ask -eq 3 ]; do + name=$($dialog --backtitle "$btitle" --title "$title" --no-cancel \ + --inputbox "\nName for the UCS Thin Client:" $size "$name" 3>&1 1>&2 2>&3) + uid=$($dialog --backtitle "$btitle" --no-cancel \ + --title "$title" --inputbox "\nName of an user with administrative rights:" \ + $size "$uid" 3>&1 1>&2 2>&3) + password=$($dialog --backtitle "$btitle" --no-cancel \ + --title "$title" --insecure \ + --passwordbox "\nPassword for user with administrative rights:" \ + $size "$password" 3>&1 1>&2 2>&3) + position=$($dialog --backtitle "$btitle" --no-cancel \ + --title "$title" --inputbox "\nLDAP position for the UCS Thin Client object:" \ + $size "$position" 3>&1 1>&2 2>&3) + + $dialog --backtitle "$btitle" --title "$title" --extra-button \ + --extra-label "Reenter" --yesno \ + "\nSettings:\n \ + \nName of UCS Thin Client: $name \ + \nUser for creation: $uid \ + \nLDAP Position: $position \ + \nLDAP Server: $ldapServer" $size + + ask=$? + + # cancel + if [ $ask -eq 1 ]; then + exit 0 + fi + + if [ -z "$name" -o -z "$password" -o -z "$uid" ]; then + ask=3 + fi + done + + # test name + object=$(ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" \ + "(&(objectClass=univentionHost)(cn=$name))" dn | ldapsearch-wrapper | grep ^dn:) + if [ -n "$object" ]; then + errorMsg="Name already exists!" + object="" + continue + fi + + # get ldap dn + userDn=$(ldapsearch -x -h "$ldapServer" -b "$thinclient_rollout_ldap_base" \ + uid="$uid" dn | ldapsearch-wrapper | grep ^dn: | awk -F ": " {'print $2'}) + if [ -z "$userDn" ]; then + errorMsg="Could not get LDAP DN for UID $uid!" + continue + fi + + pwfile=$(mktemp) + echo "$password" > "$pwfile" + + clear + + # run udm + cmd="/usr/sbin/udm computers/thinclient create --binddn \\\"$userDn\\\" --bindpwd \\\"$password\\\"" + if [ -n "$position" ]; then + cmd="$cmd --position \\\"$position\\\"" + fi + cmd="$cmd --set name=\\\"$name\\\" --set mac=\\\"$mymac\\\"" + errorMsg=$(univention-ssh "$pwfile" "$uid"@"$ldapServer" "$cmd") + rm "$pwfile" + + # test if object was created + sleep 1 + object=$(ldapsearch -h "$ldapServer" -b "$thinclient_rollout_ldap_base" -x macAddress="$mymac" dn | ldapsearch-wrapper | grep ^dn:) + + if [ -n "$object" ]; then + log_begin_msg "$object successfully created" + log_end_msg 0 + object="" + + if [ -n "$thinclient_rollout_reboot" -a "$thinclient_rollout_reboot" = "no" ]; then + log_begin_msg "reboot disabled via thinclient/rollout/reboot" + log_end_msg 0 + else + reboot + fi + exit 0 + fi + +done diff -Nur univention-thin-client-rollout.o/thin-client-default-pxe.py univention-thin-client-rollout/thin-client-default-pxe.py --- univention-thin-client-rollout.o/thin-client-default-pxe.py 1970-01-01 01:00:00.000000000 +0100 +++ univention-thin-client-rollout/thin-client-default-pxe.py 2011-08-17 10:01:33.226523302 +0200 @@ -0,0 +1,57 @@ +#!/usr/bin/python2.4 +# -*- coding: utf-8 -*- +# +# Univention thin client default pxe +# bootsplash script +# +# Copyright (C) 2004-2010 Univention GmbH +# +# http://www.univention.de/ +# +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# Binary versions of this file provided by Univention to you as +# well as other copyrighted, protected or trademarked materials like +# Logos, graphics, fonts, specific documentations and configurations, +# cryptographic keys etc. are subject to a license agreement between +# you and Univention. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import shutil +import sys +import univention.config_registry + +cr = univention.config_registry.ConfigRegistry() +cr.load() +default = "/var/lib/univention-client-boot/pxelinux.cfg/default" +defaultNet = "/etc/univention/client-boot-pxe/pxeconfig" +defaultLocal = "/etc/univention/client-boot-pxe/pxeconfig.local" + +cfg = cr.get("pxe/default", "local") + +if not os.path.isfile(default) or not os.path.isfile(defaultNet): + sys.exit(0) + +# save local pxe config +if not os.path.isfile(defaultLocal): + shutil.copyfile(default, defaultLocal) + +if cfg == "local": + shutil.copyfile(defaultLocal, default) + +if cfg == "net": + shutil.copyfile(defaultNet, default) +