#!/bin/bash

source debian/vars.sh

# Clean the build root first
rm -rf $buildroot
# Installing directories
install -d -m 755 $buildroot/var
install -d -m 755 $buildroot/var/cpanel
install -d -m 755 $buildroot/var/cpanel/plugins
install -d -m 755 $buildroot/var/cpanel/plugins/monitoring-agent
# Installing source files
install -D -m 600 $SOURCE4 $buildroot/etc/agent360.ini
install -D -m 700 $SOURCE5 $buildroot/usr/local/cpanel/scripts/agent360.sh
install -D -m 600 $SOURCE6 $buildroot/var/cpanel/plugins/monitoring-agent/README.md
install -D -m 700 $SOURCE7 $buildroot/var/cpanel/plugins/monitoring-agent/disable.sh
install -D -m 700 $SOURCE8 $buildroot/var/cpanel/plugins/monitoring-agent/enable.sh
install -D -m 700 $SOURCE9 $buildroot/var/cpanel/plugins/monitoring-agent/install.sh
install -D -m 700 $SOURCE10 $buildroot/var/cpanel/plugins/monitoring-agent/uninstall.sh
install -D -m 700 $SOURCE11 $buildroot/var/cpanel/plugins/monitoring-agent/upgrade.sh
echo "Tree for buildroot: $buildroot"
tree $buildroot
