# if u clone a vm with DB2 installed, it may not work due to the different hostname, so need to change DB2's configuration listed below
if [ -e /db2home/$db2inst1_username/sqllib/db2nodes.cfg ]; then
chmod 666 /db2home/$db2inst1_username/sqllib/db2nodes.cfg
su $db2inst1_username -c "cp /db2home/$db2inst1_username/sqllib/db2nodes.cfg /db2home/$db2inst1_username/sqllib/db2nodes.cfg.old"
su $db2inst1_username -c "echo 0 $db2_hostname 0 > /db2home/$db2inst1_username/sqllib/db2nodes.cfg"
fi
chmod 666 /var/db2/*
$DB2_PATH/adm/db2set -g db2system=$db2_hostname
su $db2inst1_username -c "$DB2_PATH/bin/db2 update admin cfg using DB2SYSTEM $db2_hostname"
su $db2inst1_username -c "$DB2_PATH/bin/db2 update admin cfg using SMTP_SERVER $db2_hostname"