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 /sbin/itzks-systems.do_preseed | |
| 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.
Diffstat (limited to 'sbin/itzks-systems.do_preseed')
| -rwxr-xr-x | sbin/itzks-systems.do_preseed | 35 | 
1 files changed, 22 insertions, 13 deletions
| 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 | 
