File: //etc/one-context.d/cpanel_license.sh
#!/bin/bash
ETH0_IP=$(grep 'ETH0_IP=' /var/run/one-context/context.sh.network | cut -d= -f2 | sed "s/'//g" )
text=$(host $ETH0_IP)
name=$(echo "$text" | awk '{print $(NF)}' | sed 's/\.$//')
hostnamectl set-hostname --static "$name"
/usr/local/cpanel/bin/set_hostname $name
echo "ADDR $ETH0_IP" >> /etc/wwwacct.conf
echo "name $name" >> /etc/wwwacct.conf
/scripts/rebuildhttpdconf
mv /etc/one-context.d/net-15-hostname /root/
echo "activating cpanel license"
/usr/local/cpanel/cpkeyclt