Skip to content

Instantly share code, notes, and snippets.

@glennschler
glennschler / ora-ec2hosts
Created June 10, 2012 18:53
Removes old entries of local hostname from the hosts file since the REH EC2 image inserts a new entry every reboot
#! /bin/sh -x
#
# chkconfig: 2345 96 99
# description: removes old entries for this server name from the host file
# add then adds the correct hosts entry
#
hname=`hostname`
lev=`who -r`
echo "Called with ${1} hostname=${hname} ${lev}" | logger -t 'ora-ec2hosts'