Change host address/name after Linux install

  • I just installed DimDim Dimdim_installer_centos4.5_32bit_offline onto a virgin install of CentOS 4.5.

    The install process did not ask me what IP address I wanted to use or what hostname. It just turned out with the behind-the-firewall IP address hard coded into many files. The documentation I could read suggest I change however I can see the offending IP address lurking in other files too resulting in the audio/video recorder never connecting. Here is the list of affected files I found in /usr/local/dimdim...


    Certainly, I can deal with this using a nifty one-liner such as...

    for i in `find . -type f -print0 | xargs -0 grep -li "<WRONG IP ADDRESS>" | grep -v ".log"`; do sed -i "$i" 's/<WRONG IP ADDRESS>/<RIGHT IP ADDRESS or HOSTNAME>/gi'; done

    Where the <WRONG IP ADDRESS> is what gets assumed during install and the <RIGHT IP ADDRESS or HOSTNAME> is what I wanted it to be.

    However, I'm curious if there is a more supported way of doing this. Also, if the Windows installer gathers this information during the install then why not the Linux installer?

    • Correction to the above one-liner with a real IP address example. This should also work quicker.

      for i in `find /usr/local/dimdim/ConferenceServer -type f -print0 | xargs -0 grep -li "" | grep -v ".log"`; do sed -i 's/192\.168\.1\.10/my\.domain\.com/gi' "$i"; done