#!/bin/bash

# désactivation du shell pour www-data
container_path_web=$(CreoleGet container_path_web)
if [ -n "$container_path_web" ];then
    CHROOT="chroot $container_path_web"
else
    CHROOT=""
fi
TUSER="www-data"
NEWSHELL="/bin/false"
OLDSHELL="`$CHROOT getent passwd $TUSER|awk -F: '{ print $7 }'`"
[ ! "$OLDSHELL" = "$NEWSHELL" ] && $CHROOT usermod -s $NEWSHELL $TUSER

# choix de la version de PHP par défaut
default_php_version=$(CreoleGet default_php_version "")
if [ -n "$default_php_version" ]
then
	$CHROOT update-alternatives --set php /usr/bin/php$(CreoleGet default_php_version)
else
    $CHROOT update-alternatives --auto php
fi

exit 0
