#!/bin/bash

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

. /opt/cloudlinux/venv/usr/share/python-cllib/scripts/cl-common
common_path_of_cpanel="/usr/share/cagefs/cpanel"

writeToLog "[CageFS] posteasyapache: refreshing CageFS" "$common_path_of_cpanel"

nohup /usr/bin/ionice -c 3 /usr/sbin/cagefsctl --force-update > /dev/null &

/usr/share/cagefs-plugins/install-cagefs-plugin.py --add-usr-local-easy-mount
/usr/share/cagefs-plugins/install-cagefs-plugin.py --setup-ea-php-sessions
if [ -e /usr/share/cagefs/need.remount ]; then
    /usr/sbin/cagefsctl --remount-all
fi

exit 0
