summaryrefslogtreecommitdiff
path: root/sbin/itzks-systems.do_preseed
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/itzks-systems.do_preseed')
-rwxr-xr-xsbin/itzks-systems.do_preseed35
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