FreePBX HA-Changing the hostname displayed in the shell

It is often handy to be able to differentiate between different FreePBX HA clusters, but, the hostnames must not be changed.  An easy way to resolve this is to edit the .bashrc file in the home directory of the user you wish to log in as.

For example, you might wish to change the displayed hostname to be 'Canada-Cluster-a'. Simply edit the .bashrc file to look like this:

# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' HOSTNAME="Canada-Cluster-a" # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi export VISUAL=vim export PS1="[\u@$HOSTNAME \W]\\$ "

The only two changes are defining the HOSTNAME before /etc/bashrc is called, and editing the prompt to use that variable.

Note that this will also change the window title of terminals that support title changing to match what you define

Return to Documentation Home I Return to Sangoma Support