diff options
| author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-10-02 06:24:14 +0200 | 
|---|---|---|
| committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-10-02 06:24:14 +0200 | 
| commit | 8bf4295ec61896769f68b517572a7b18da2c363a (patch) | |
| tree | c7542baa5360470c8a343c466a069e7aa06ef15b | |
| parent | aa924a42627aae0f6d426bd3f488a4581fc9309d (diff) | |
| download | itzks-systems-8bf4295ec61896769f68b517572a7b18da2c363a.tar.gz itzks-systems-8bf4295ec61896769f68b517572a7b18da2c363a.tar.bz2 itzks-systems-8bf4295ec61896769f68b517572a7b18da2c363a.zip | |
Allow setting of ITZkS customer name via itzks.do_preseed $1.
| -rw-r--r-- | debian/changelog | 1 | ||||
| -rwxr-xr-x | debian/config | 2 | ||||
| -rwxr-xr-x | sbin/itzks-systems.do_preseed | 35 | 
3 files changed, 24 insertions, 14 deletions
| diff --git a/debian/changelog b/debian/changelog index 3a5715a..ebb81ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ itzks-systems (2014.09.23.2) UNRELEASED; urgency=medium    * itzks-transfer-cleaner: Only remove empty directories that have reached the      age given in $TRANSFER_DEL_PERFORM. +  * Allow setting of ITZkS customer name via itzks.do_preseed $1.   -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de>  Tue, 23 Sep 2014 13:11:42 +0200 diff --git a/debian/config b/debian/config index 6cea5fe..c217b74 100755 --- a/debian/config +++ b/debian/config @@ -5,6 +5,6 @@ set -e  # Source debconf library.  . /usr/share/debconf/confmodule -db_input critical itzks-systems-common/customer-name || true +db_input high itzks-systems-common/customer-name || true  db_go diff --git a/sbin/itzks-systems.do_preseed b/sbin/itzks-systems.do_preseed index 6632caa..3d0c0cd 100755 --- a/sbin/itzks-systems.do_preseed +++ b/sbin/itzks-systems.do_preseed @@ -20,24 +20,33 @@  set -e  do_preseed() { -    pkg="$1" -    template="$2" -    type="$3" -    value="$4" -    echo "Preseeding $template to $value" -    echo $pkg $template $type "$value" | debconf-set-selections || \ -        echo "Failed to load preseed '$template'" 1>&2 +	pkg="$1" +	template="$2" +	type="$3" +	value="$4" +	echo "Preseeding $template to $value" +	echo $pkg $template $type "$value" | debconf-set-selections || \ +	    echo "Failed to load preseed '$template'" 1>&2  } -CUSTOMER=$(cat /etc/debian-edu/itzks.school) +do_reconfigure() { +	package="$1" +	echo "Silently running dpkg-reconfigure on package $package ... " +	dpkg -l $package 1>/dev/null 2>/dev/null && { +		dpkg-reconfigure -pcritical $package && echo "DONE." || echo "FAILED!!!" +	} || echo "NEEDS INSTALL." +	echo +} + +if [ -n "$1" ]; then +	do_preseed itzks-systems-common itzks-systems-common/customer-name  string "$1" +	do_reconfigure itzks-systems-common +fi +CUSTOMER="$(cat /etc/debian-edu/itzks.school)"  # and finally preseed ocsinventory-agent  do_preseed ocsinventory-agent ocsinventory-agent/tag  string $CUSTOMER  do_preseed ocsinventory-agent ocsinventory-agent/method select  http  do_preseed ocsinventory-agent ocsinventory-agent/server string  inventory.it-zukunft-schule.de +do_reconfigure ocsinventory-agent -echo "Silently running dpkg-reconfigure on package ocsinventory-agent ... " -dpkg -l ocsinventory-agent 1>/dev/null 2>/dev/null && {  -    dpkg-reconfigure -pcritical ocsinventory-agent && echo "DONE." || echo "FAILED!!!" -} || echo "NEEDS INSTALL." -echo | 
