#!/bin/sh # postinst script for lmd-server # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) #if [ ! -L "/var/www/ipxeboot" ] ; then # ln -s /usr/share/lmd-server/www-boot /var/www/ipxeboot #fi # enable site #if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then # . /usr/share/apache2/apache2-maintscript-helper # apache2_invoke ensite ipxeboot #fi #invoke-rc.d apache2 reload || true n4d-modules enable-plugin /etc/n4d/conf.d/LmdServer.json || true n4d-modules enable-plugin /etc/n4d/conf.d/LmdImageManager.json || true n4d-modules enable-plugin /etc/n4d/conf.d/LmdTemplateManager.json || true n4d-modules enable-plugin /etc/n4d/conf.d/LmdBootManager.json || true n4d-modules enable-plugin /etc/n4d/conf.d/LmdClientManager.json || true ltsp initrd || true set +e if [ -e '/var/lib/tftpboot/ltsp/lts.conf' ]; then rc=$(grep "LDM_LANGUAGE" /var/lib/tftpboot/ltsp/lts.conf; echo $?) if [ "$rc" = "1" ]; then DefaultKey=$(grep -i "\[default\]" /var/lib/tftpboot/ltsp/lts.conf | sed -e "s/\[/\\\[/g" | sed -e "s/\]/\\\]/g") sed --follow-symlinks -i -e "s/$DefaultKey/$DefaultKey\nLDM_LANGUAGE=\"es_ES.UTF-8\"/g" /var/lib/tftpboot/ltsp/lts.conf fi rc=$(grep "TIMEZONE" /var/lib/tftpboot/ltsp/lts.conf > /dev/null; echo $?) if [ "$rc" = "1" ]; then if [ -e "/etc/timezone" ]; then TZ=$(cat /etc/timezone) echo "\n# Server timezone\nTIMEZONE = \"$TZ\"" >> /var/lib/tftpboot/ltsp/lts.conf fi fi fi set -e mkdir -p /etc/ldm || true if [ ! -e /etc/ldm/ldminfod-locale-whitelist ]; then cp /usr/share/lmd-server/lmd-server-config/ldminfod-locale-whitelist /etc/ldm/ || true fi #echo "Restarting dnsmasq" #invoke-rc.d dnsmasq restart || true PKG="lmd-server" ORIGINAL_FILE="/etc/ltsp/ltsp-update-image.excludes" NEW_DIVERTED_FILE="/etc/ltsp/ltsp-update-image.excludes.diverted" LLIUREX_FILE="/etc/ltsp/ltsp-update-image.excludes.lliurex" if [ ! -L "$ORIGINAL_FILE" ]; then dpkg-divert --add --package ${PKG} --rename --divert "$NEW_DIVERTED_FILE" "$ORIGINAL_FILE" ln -s "$LLIUREX_FILE" "$ORIGINAL_FILE" fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # Copy lts.conf template to $tftproot/ltsp test -f /var/lib/tftpboot/ltsp/i386/lts.conf || cp /usr/share/lmd-server/templates/lts.conf /var/lib/tftpboot/ltsp/i386/ # And lts.default.conf, for further lts.confs creation test -f /var/lib/tftpboot/ltsp/i386/lts.default.conf || cp /usr/share/lmd-server/templates/lts.conf /var/lib/tftpboot/ltsp/i386/lts.default.conf # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0