#!/bin/sh # postinstall code commented # pmb configured with lliurex-zero-pmb set -e pmb_timeout_file="/etc/apache2/conf-available/pmb.conf" pmb_ensite="/etc/apache2/sites-enabled/pmb.conf" case "$1" in configure) if dpkg --compare-versions "$2" lt 0.58.4.3; then idcontainer=$(docker ps -a -f "name=pmb" -q 2>/dev/null) if [ "x$idcontainer" != "x" ]; then docker stop pmb docker rm -f pmb docker run -d --restart always --name pmb -v /usr/share/lliurex-pmb/resolv.conf:/etc/resolv.conf:ro -v /usr/share/pmb/www:/var/www/html -v /var/lib/pmb:/var/lib/pmb -v /etc/pmb:/etc/pmb -v /var/run/mysqld:/var/run/mysqld -p 800:80 lliurex/pmb_base fi fi if [ -f $pmb_ensite ];then if [ -f $pmb_timeout_file ];then a2enconf pmb || true systemctl restart apache2 || true fi fi chown www-data:www-data /var/lib/lliurex-www/links/opac.json || true ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0