#!/bin/sh
### Copyright 1999-2017. Parallels IP Holdings GmbH. All Rights Reserved.

if [ -n "$PLESK_INSTALLER_DEBUG" -o -n "$PLESK_INSTALLER_VERBOSE" ]; then
	set -x;
fi

prog="`basename $0`"
tmp_d="/usr/local/psa/var"
mu_flag="$tmp_d/${mu}-maintenance.flag"

[ -f "$mu_flag" ] && exit 0

mkdir -p $tmp_d/maintenance
chown psaadm:psaadm $tmp_d/maintenance
chmod 0750 $tmp_d/maintenance

mfile="/etc/sw-cp-server/conf.d/maintenance"
echo 'set $maintenance off;' > $mfile
chown root:root $mfile
chmod 0644 $mfile

touch $mu_flag
exit 0
