#!/bin/bash

if [ ! -e /home/wpkg/hosts.xml ]; then
    cat > /home/wpkg/hosts.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<wpkg>
<host />
</wpkg>
EOF

    cat > /home/wpkg/profiles.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<profiles>
    <profile/>
</profiles>
EOF

    [ ! -d /home/wpkg/profiles ] && mkdir -p /home/wpkg/profiles
    chmod -R 755 /home/wpkg
    getfacl --access --absolute-names /home/wpkg|setfacl -d -RM - /home/wpkg
fi
