update(){
a=`cphaprob stat|grep local|awk '{print $5}'`; case $a in *CTIVE*|*ctive*) a=`tput setaf 2; echo $a`;; *TANDBY*|*tandby*) a=`tput setaf 5; echo $a`;; *) a=`tput setaf 1; echo $a`; esac;
f_rammb=$(free -m |grep "Mem:" |awk '{print $3}');f_ramdec=${f_rammb:${#f_rammb}-3:${#f_rammb}};f_ramint=${f_rammb:0:${#f_rammb}-3};
f_ramgb=$(echo "$f_ramint.$f_ramdec");f_ramgb=${f_ramgb:0:${#f_ramgb}-2};
cpu=$(uptime | rev | awk '{print $3}'|tr -d ',' | rev);
PS1="[\033[1m$version\033[0m:$a\e[0m:\e[96m\]RAM=$f_ramgb/$m_ramgb\]GB\e[0m:\e[36m\]CPU Usage=$cpu\e[0m:\e[1;35m\]SecureXL=$securexl\e[0m:\e[1;32m\]CoreXL Active=$corexl\e[0m]\n[Expert@\h:$INSTANCE_VSID]# ";
}
m_rammb=$(free -m |grep "Mem:" |awk '{print $2}');m_ramdec=${m_rammb:${#m_rammb}-3:${#m_rammb}};m_ramint=${m_rammb:0:${#m_rammb}-3};
m_ramgb=$(echo "$m_ramint.$m_ramdec");m_ramgb=${m_ramgb:0:${#m_ramgb}-2};
version=$(cpstat os -f all | grep "SVN Foundation Version String:" | awk '{print $5}');
securexl=$(fwaccel stat | grep Acceleration | awk '{print $3}'| tr -d '|');
if [ -z "$(fw ctl multik stat)" ];then corexl="Disabled";else corexl=$(fw ctl multik stat | cut -f 2 -d '|'|tail -n +3);iterations=$(echo $corexl|wc -w) cores_active=0;for((i=1;i<=$iterations;i+=1));
do core=$(echo $corexl|cut -f $i -d ' ');if [ "Yes" == $core ]; then cores_active=$((cores_active+1));fi;done;if [ "$cores_active" -eq "$iterations" ]; then corexl="ALL";else corexl=$cores_active;fi;fi;
PROMPT_COMMAND=update