CoGe VM

From CoGepedia
Revision as of 17:03, 10 July 2014 by Franka1 (Talk | contribs)

Jump to: navigation, search

Auto-updating IP Address

Since the Atmosphere Virtual Machines change IP Address every time they are suspended and resumed, a script is required to automatically update the IP Address in the coge.conf file.

First, create the directory in which this script will reside

sudo mkdir /etc/atmo
sudo mkdir /etc/atmo/post-scripts.d
cd /etc/atmo/post-scripts.d

Then create a file

sudo nano IPsetup

Paste the following into the contents of IPsetup

#!/bin/sh
HNAME=$(hostname -i)
sed -i "s/^SERVER.*/SERVER     http:\/\/$HNAME\//g" /opt/coge/web/coge.conf

Make sure to edit /opt/coge/web/coge.conf to point to the correct path for coge.conf