#!/bin/bash
source ~oracle/.bash_profile
if ! [ -z $1 ] ; then
	sed -i -E "s/HOST = [^()]*/HOST = ${1}/" ${ORACLE_HOME}/network/admin/listener.ora
	grep 'HOST =' ${ORACLE_HOME}/network/admin/listener.ora
	sed -i -E "s/HOST = [^()]*/HOST = ${1}/" ${ORACLE_HOME}/network/admin/tnsnames.ora
	grep 'HOST =' ${ORACLE_HOME}/network/admin/tnsnames.ora
	$Yellow "监听配置已修改: ${1} ,请手动重启监听 " $End
else
	$Red "使用方法:  命令 计算机名称" $End
fi